forked from MapComplete/MapComplete
Fix: interpret missing level tag as 'level=0'
This commit is contained in:
parent
8b5daefc90
commit
5d8b422162
2 changed files with 11 additions and 4 deletions
|
@ -65,13 +65,18 @@ export default class LayerState {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const t = Translations.t.general.levelSelection
|
const t = Translations.t.general.levelSelection
|
||||||
|
const conditionsOrred = [
|
||||||
|
new Tag("level", "" + level),
|
||||||
|
new RegexTag("level", new RegExp("(.*;)?" + level + "(;.*)?")),
|
||||||
|
]
|
||||||
|
if(level === "0") {
|
||||||
|
conditionsOrred.push(new Tag("level", "")) // No level tag is the same as level '0'
|
||||||
|
}
|
||||||
|
console.log("Setting levels filter to", conditionsOrred)
|
||||||
this.globalFilters.data.push({
|
this.globalFilters.data.push({
|
||||||
id: "level",
|
id: "level",
|
||||||
state: level,
|
state: level,
|
||||||
osmTags: new Or([
|
osmTags: new Or(conditionsOrred),
|
||||||
new Tag("level", "" + level),
|
|
||||||
new RegexTag("level", new RegExp("(.*;)?" + level + "(;.*)?")),
|
|
||||||
]),
|
|
||||||
onNewPoint: {
|
onNewPoint: {
|
||||||
tags: [new Tag("level", level)],
|
tags: [new Tag("level", level)],
|
||||||
icon: "./assets/svg/elevator.svg",
|
icon: "./assets/svg/elevator.svg",
|
||||||
|
|
|
@ -270,6 +270,8 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
||||||
for (const l of levels) {
|
for (const l of levels) {
|
||||||
floors.add(l)
|
floors.add(l)
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
floors.add("0") // '0' is the default and is thus _always_ present
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const sorted = Array.from(floors)
|
const sorted = Array.from(floors)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue