diff --git a/components/src/maplibre/VectorLayer/VectorLayer.stories.svelte b/components/src/maplibre/VectorLayer/VectorLayer.stories.svelte index e44d33d3..c5ce2aae 100644 --- a/components/src/maplibre/VectorLayer/VectorLayer.stories.svelte +++ b/components/src/maplibre/VectorLayer/VectorLayer.stories.svelte @@ -11,7 +11,7 @@ import SamplePoints from './sample-points.json'; import { SWRDataLabLight } from '../MapStyle'; - import type { FilterSpecification } from 'maplibre-gl'; + import type { Feature, FilterSpecification, MapGeoJSONFeature } from 'maplibre-gl'; import { tokens } from '../../DesignTokens'; const { Story } = defineMeta({ @@ -24,14 +24,17 @@ ['>', 'coverage_2025', 1] ]; + const layers: string[] = ['hochwasser_depth_L', 'hochwasser_depth_M', 'hochwasser_depth_H']; + let selectedFilter: any = $state(0); + let selectedLayer: any = $state(0); - let hovered: any = $state(); - const handleMouseMove = (e) => { + let hovered: MapGeoJSONFeature | undefined = $state(); + const handleMouseMove = (e: any) => { hovered = e.features?.[0]; }; const handleMouseLeave = () => { - hovered = null; + hovered = undefined; }; @@ -170,6 +173,48 @@ + + + + Select layer + + {#each layers as l, i} + {l} + {/each} + + + + + + + + + + + + +