Closed SiddHyper closed 1 year ago
Map.svelte
<script lang="ts"> import { MapLibre, ScaleControl } from 'svelte-maplibre'; import LayerSelector from './components/layer-selector.svelte'; import { Layers } from './store/layer.store'; let styleURL: string; Layers.subscribe((value) => { styleURL = value.styleURL; }); </script> <div>{styleURL}</div> <MapLibre style={styleURL} class="relative h-screen w-full" attributionControl={false}> <LayerSelector /> <ScaleControl /> </MapLibre>
layer.store.ts
import { writable } from 'svelte/store'; import { MAP_LAYERS } from '../constants'; export const Layers = writable(MAP_LAYERS[0]);
the url in web page as string is changing but the map doesn't change with that
Released in v0.3.5
Map.svelte
layer.store.ts
the url in web page as string is changing but the map doesn't change with that