forked from MapComplete/MapComplete
Add auto icon picker for presets
This commit is contained in:
parent
f67508336a
commit
ca391e948d
11 changed files with 18 additions and 13 deletions
|
@ -16,14 +16,12 @@ export class Overpass {
|
|||
|
||||
public buildQuery(bbox: string): string {
|
||||
const filters = this._filter.asOverpass()
|
||||
console.log(filters)
|
||||
let filter = ""
|
||||
for (const filterOr of filters) {
|
||||
filter += 'nwr' + filterOr + ';'
|
||||
}
|
||||
const query =
|
||||
'[out:json][timeout:25]' + bbox + ';(' + filter + ');out body;>;out skel qt;'
|
||||
console.log(query)
|
||||
return "https://overpass-api.de/api/interpreter?data=" + encodeURIComponent(query)
|
||||
}
|
||||
|
||||
|
|
|
@ -276,7 +276,8 @@ export class TagUtils {
|
|||
static ApplyTemplate(template: string, tags: any): string {
|
||||
for (const k in tags) {
|
||||
while (template.indexOf("{" + k + "}") >= 0) {
|
||||
template = template.replace("{" + k + "}", tags[k]);
|
||||
const escaped = tags[k].replace(/</g, '<').replace(/>/g, '>');
|
||||
template = template.replace("{" + k + "}", escaped);
|
||||
}
|
||||
}
|
||||
return template;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue