forked from MapComplete/MapComplete
Port bicycle cafés to JSON-defined-layer
This commit is contained in:
parent
3653c3ecaa
commit
0c2f662040
17 changed files with 229 additions and 276 deletions
|
@ -29,7 +29,10 @@ export class RegexTag extends TagsFilter {
|
|||
}
|
||||
|
||||
asOverpass(): string[] {
|
||||
return [`['${RegexTag.source(this.key)}'${this.invert ? "!" : ""}~'${RegexTag.source(this.value)}']`];
|
||||
if (typeof this.key === "string") {
|
||||
return [`['${this.key}'${this.invert ? "!" : ""}~'${RegexTag.source(this.value)}']`];
|
||||
}
|
||||
return [`[~'${this.key.source}'${this.invert ? "!" : ""}~'${RegexTag.source(this.value)}']`];
|
||||
}
|
||||
|
||||
private static doesMatch(fromTag: string, possibleRegex: string | RegExp): boolean {
|
||||
|
@ -68,7 +71,7 @@ export class RegexTag extends TagsFilter {
|
|||
if (typeof this.key === "string") {
|
||||
return `${this.key}${this.invert ? "!" : ""}~${RegexTag.source(this.value)}`;
|
||||
}
|
||||
return `~${this.key.source}${this.invert ? "!" : ""}~${RegexTag.source(this.value)}`
|
||||
return `${this.key.source}${this.invert ? "!" : ""}~~${RegexTag.source(this.value)}`
|
||||
}
|
||||
|
||||
isEquivalent(other: TagsFilter): boolean {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue