Themes(toilets): improve tagging of wheelchair accessible toilets, various fixes to make this possible

This commit is contained in:
Pieter Vander Vennet 2025-04-05 04:01:19 +02:00
parent 1e84c2cc4d
commit 089017b136
19 changed files with 617 additions and 223 deletions

View file

@ -1,6 +1,6 @@
import { SpecialVisualizationState, SpecialVisualizationSvelte } from "../SpecialVisualization"
import SvelteUIElement from "../Base/SvelteUIElement"
import { UIEventSource } from "../../Logic/UIEventSource"
import { ImmutableStore, Store, UIEventSource } from "../../Logic/UIEventSource"
import { Feature } from "geojson"
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import Questionbox from "../Popup/TagRendering/Questionbox.svelte"
@ -31,6 +31,11 @@ class QuestionViz implements SpecialVisualizationSvelte {
name: "blacklisted-labels",
doc: "One or more ';'-separated labels of questions which should _not_ be included. Note that the questionbox which is added by default will blacklist 'hidden'"
},
{
name: "show_all",
default: "user-preference",
doc: "Either `no`, `yes` or `user-preference`. Indicates if all questions should be shown at once"
}
]
svelteBased = true
group: "default"
@ -50,6 +55,13 @@ class QuestionViz implements SpecialVisualizationSvelte {
?.split(";")
?.map((s) => s.trim())
?.filter((s) => s !== "")
const showAll = args[2]
let showAllQuestionsAtOnce: Store<boolean> = state.userRelatedState?.showAllQuestionsAtOnce
if (showAll === "yes") {
showAllQuestionsAtOnce = new ImmutableStore(true)
} else if (showAll === "no") {
showAllQuestionsAtOnce = new ImmutableStore(false)
}
return new SvelteUIElement(Questionbox, {
layer,
tags,
@ -57,6 +69,7 @@ class QuestionViz implements SpecialVisualizationSvelte {
state,
onlyForLabels: labels,
notForLabels: blacklist,
showAllQuestionsAtOnce
})
}
}