Themes(climbing): make map bigger, fix histogram

This commit is contained in:
Pieter Vander Vennet 2025-07-11 04:26:56 +02:00
parent 2ddf0c36be
commit 7f6ccda387
4 changed files with 30 additions and 16 deletions

View file

@ -74,14 +74,17 @@ export class HistogramViz extends SpecialVisualization {
}
const listSource: Store<string[]> = tagSource.map((tags) => {
const value = tags[args[0]]
try {
const value = tags[args[0]]
if (value === "" || value === undefined) {
return undefined
}
if(Array.isArray(value)){
return value
}
return JSON.parse(value)
} catch (e) {
console.error("Could not load histogram: parsing of the list failed: ", e)
console.error("Could not load histogram: parsing of the list failed: ", e,"\nthe data to parse is",value)
return undefined
}
})

View file

@ -11,11 +11,11 @@
export let state: SpecialVisualizationState
export let tagSource: UIEventSource<Record<string, string>>
export let args: string[]
export let defaultzoom: number
export let idkeys: string[]
export let feature: Feature
const keys = [...args]
keys.splice(0, 1)
export let clss : string = "h-40 rounded"
const keys =idkeys
let featuresToShow: Store<Feature[]> = state.indexedFeatures.featuresById.map(
(featuresById) => {
if (featuresById === undefined) {
@ -62,13 +62,8 @@
mla.allowMoving.setData(false)
mla.allowZooming.setData(false)
mla.location.setData({ lon, lat })
mla.zoom.setData(defaultzoom)
if (args[0]) {
const parsed = Number(args[0])
if (!isNaN(parsed) && parsed > 0 && parsed < 25) {
mla.zoom.setData(parsed)
}
}
ShowDataLayer.showMultipleLayers(
mlmap,
@ -78,7 +73,7 @@
)
</script>
<div class="h-40 rounded" style="overflow: hidden; pointer-events: none;">
<div class={clss} style="overflow: hidden; pointer-events: none;">
<DelayedComponent>
<MaplibreMap interactive={false} map={mlmap} mapProperties={mla} />
</DelayedComponent>