diff --git a/website/src/lib/components/Data.svelte b/website/src/lib/components/Data.svelte index 3b6f6eea..d0a8e327 100644 --- a/website/src/lib/components/Data.svelte +++ b/website/src/lib/components/Data.svelte @@ -1,11 +1,7 @@ {#each files as file} - + {/each} diff --git a/website/src/lib/components/GPX.svelte b/website/src/lib/components/GPX.svelte index d79255ec..ad294e3b 100644 --- a/website/src/lib/components/GPX.svelte +++ b/website/src/lib/components/GPX.svelte @@ -1,18 +1,17 @@
diff --git a/website/src/lib/components/custom-control/CustomControl.svelte b/website/src/lib/components/custom-control/CustomControl.svelte index d6467127..f759205a 100644 --- a/website/src/lib/components/custom-control/CustomControl.svelte +++ b/website/src/lib/components/custom-control/CustomControl.svelte @@ -1,18 +1,20 @@ diff --git a/website/src/lib/components/layer-control/LayerControl.svelte b/website/src/lib/components/layer-control/LayerControl.svelte index 663f6db2..a9f5cb3e 100644 --- a/website/src/lib/components/layer-control/LayerControl.svelte +++ b/website/src/lib/components/layer-control/LayerControl.svelte @@ -1,6 +1,4 @@ - +
@@ -42,8 +42,8 @@ layerTree={basemapTree} name="basemaps" onValueChange={(id) => { - if (map) { - map.setStyle(basemaps[id]); + if ($map) { + $map.setStyle(basemaps[id]); } }} /> @@ -55,12 +55,12 @@ name="overlays" multiple={true} onValueChange={(id, checked) => { - if (map) { + if ($map) { if (checked) { - if (!map.getSource(id)) { - map.addSource(id, overlays[id]); + if (!$map.getSource(id)) { + $map.addSource(id, overlays[id]); } - map.addLayer({ + $map.addLayer({ id, type: overlays[id].type === 'raster' ? 'raster' : 'line', source: id, @@ -73,7 +73,7 @@ } }); } else { - map.removeLayer(id); + $map.removeLayer(id); } } }} diff --git a/website/src/lib/stores.ts b/website/src/lib/stores.ts new file mode 100644 index 00000000..9b168917 --- /dev/null +++ b/website/src/lib/stores.ts @@ -0,0 +1,5 @@ +import { writable } from 'svelte/store'; + +import mapboxgl from 'mapbox-gl'; + +export const map = writable(null); \ No newline at end of file diff --git a/website/src/routes/+page.svelte b/website/src/routes/+page.svelte index 7a262867..09dee7d7 100644 --- a/website/src/routes/+page.svelte +++ b/website/src/routes/+page.svelte @@ -1,22 +1,18 @@
- - - + + +
Test