forked from MapComplete/MapComplete
Add layer icon to filter view
This commit is contained in:
parent
1cfcfea314
commit
f5d6441b70
6 changed files with 55 additions and 39 deletions
|
@ -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
|
||||
})
|
||||
|
|
|
@ -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, '<').replace(/>/g, '>');
|
||||
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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue