Add layer icon to filter view

This commit is contained in:
Pieter Vander Vennet 2021-10-30 02:34:16 +02:00
parent 1cfcfea314
commit f5d6441b70
6 changed files with 55 additions and 39 deletions

View file

@ -39,6 +39,7 @@ export default class CreateNewWayAction extends OsmChangeAction {
}
const newPoint = new CreateNewNodeAction([], coordinate.lat, coordinate.lon, {
allowReuseOfPreviouslyCreatedPoints: true,
changeType: null,
theme: this._options.theme
})

View file

@ -19,16 +19,6 @@ export class TagUtils {
[">", (a, b) => a > b],
]
static ApplyTemplate(template: string, tags: any): string {
for (const k in tags) {
while (template.indexOf("{" + k + "}") >= 0) {
const escaped = tags[k].replace(/</g, '&lt;').replace(/>/g, '&gt;');
template = template.replace("{" + k + "}", escaped);
}
}
return template;
}
static KVtoProperties(tags: Tag[]): any {
const properties = {};
for (const tag of tags) {
@ -37,6 +27,14 @@ export class TagUtils {
return properties;
}
static changeAsProperties(kvs : {k: string, v: string}[]): any {
const tags = {}
for (const kv of kvs) {
tags[kv.k] = kv.v
}
return tags
}
/**
* Given two hashes of {key --> values[]}, makes sure that every neededTag is present in availableTags
*/