forked from MapComplete/MapComplete
Add taginfo project file descriptions
This commit is contained in:
parent
6f75dfe697
commit
05b05a958c
30 changed files with 883 additions and 8 deletions
|
@ -61,7 +61,11 @@ export class Or extends TagsFilter {
|
|||
}
|
||||
|
||||
asChange(properties: any): { k: string; v: string }[] {
|
||||
throw "Can not convert an 'or' into a changeset"
|
||||
const result = []
|
||||
for (const tagsFilter of this.or) {
|
||||
result.push(...tagsFilter.asChange(properties))
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,19 @@ export class RegexTag extends TagsFilter {
|
|||
}
|
||||
|
||||
asChange(properties: any): { k: string; v: string }[] {
|
||||
throw "Cannot convert a regex-tag into a change";
|
||||
if(this.invert){
|
||||
return []
|
||||
}
|
||||
if (typeof this.key === "string") {
|
||||
if( typeof this.value === "string"){
|
||||
return [{k: this.key, v: this.value}]
|
||||
}
|
||||
if(this.value.toString() != "/^..*$/"){
|
||||
console.warn("Regex value in tag; using wildcard:", this.key, this.value)
|
||||
}
|
||||
return [{k: this.key, v: undefined}]
|
||||
}
|
||||
console.error("Cannot export regex tag to asChange; ", this.key, this.value)
|
||||
return []
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@ export abstract class TagsFilter {
|
|||
abstract asHumanString(linkToWiki: boolean, shorten: boolean, properties: any);
|
||||
|
||||
abstract usedKeys(): string[];
|
||||
|
||||
|
||||
/**
|
||||
* Converts the tagsFilter into a list of key-values that should be uploaded to OSM.
|
||||
* Throws an error if not applicable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue