forked from MapComplete/MapComplete
UX: use correct initial value for floor selector
This commit is contained in:
parent
2c8d207866
commit
26902c488f
1 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue