UX: use correct initial value for floor selector

This commit is contained in:
Pieter Vander Vennet 2025-04-23 10:47:30 +02:00
parent 2c8d207866
commit 26902c488f

View file

@ -11,14 +11,15 @@
export let zoom: Store<number>
const maxZoom = 16
const all = "All"
let floorWithAll = floors.mapD(floors => {
if (floors.length > 1) {
return [...floors, "All"]
return [...floors, all]
}
return floors
})
let selectedFloor: UIEventSource<string> = new UIEventSource<string>(undefined)
let selectedFloor: UIEventSource<string> = new UIEventSource<string>(all)
selectedFloor.stabilized(5).map(
(floor) => {
@ -26,7 +27,7 @@
// Only a single floor is visible -> disable the 'level' global filter
// OR we might have zoomed out to much ant want to show all
layerState.setLevelFilter(undefined)
} else if (floor === "All") {
} else if (floor === all) {
layerState.setLevelFilter(undefined)
} else {
layerState.setLevelFilter(floor)