Add auto icon picker for presets

This commit is contained in:
Pieter Vander Vennet 2020-07-29 19:43:15 +02:00
parent f67508336a
commit ca391e948d
11 changed files with 18 additions and 13 deletions

View file

@ -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)
}

View file

@ -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, '&lt;').replace(/>/g, '&gt;');
template = template.replace("{" + k + "}", escaped);
}
}
return template;