From a9133decc9fbe7e62d412e5359fbefee0177ec17 Mon Sep 17 00:00:00 2001 From: Max Kohler Date: Mon, 9 Mar 2026 16:14:00 +0100 Subject: [PATCH 1/2] Add test case --- .../src/maplibre/MapStyle/SWRDataLabLight.ts | 4 +- .../src/maplibre/Source/MapSource.svelte | 2 +- .../VectorTileSource.stories.svelte | 48 +++- .../VectorTileSource/VectorTileSource.svelte | 11 +- package-lock.json | 250 ++++++------------ 5 files changed, 135 insertions(+), 180 deletions(-) diff --git a/components/src/maplibre/MapStyle/SWRDataLabLight.ts b/components/src/maplibre/MapStyle/SWRDataLabLight.ts index 6598fc5c..6e829be1 100644 --- a/components/src/maplibre/MapStyle/SWRDataLabLight.ts +++ b/components/src/maplibre/MapStyle/SWRDataLabLight.ts @@ -24,7 +24,7 @@ const tokens = { sans_bold: ['swr_sans_bold'], background: { stops: [ - [6, 'hsl(24, 20%, 97%)'], + [6, 'hsl(24, 20%, 96%)'], [6.5, 'hsl(24, 10%, 99%)'] ] }, @@ -37,7 +37,7 @@ const tokens = { sand: 'hsl(60, 0%, 95%)', rock: 'hsl(192, 0%, 90%)', street_primary: 'hsl(0, 4%, 95%)', - street_primary_faded: 'hsl(0, 4%, 93%)', + street_primary_faded: 'hsl(0, 4%, 90%)', street_primary_case: 'hsl(240, 1%, 84%)', street_secondary: 'hsl(0, 0%, 95%)', street_secondary_case: 'hsl(0, 0%, 75%)', diff --git a/components/src/maplibre/Source/MapSource.svelte b/components/src/maplibre/Source/MapSource.svelte index bc68a0ba..ebe7ecb5 100644 --- a/components/src/maplibre/Source/MapSource.svelte +++ b/components/src/maplibre/Source/MapSource.svelte @@ -26,7 +26,7 @@ // actual source object back from the map instance $effect(() => { if (map && styleLoaded && firstRun) { - map.addSource(id, $state.snapshot(sourceSpec) as SourceSpecification); + map.addSource(id, $state.snapshot(sourceSpec)); source = map.getSource(id); firstRun = false; } diff --git a/components/src/maplibre/VectorTileSource/VectorTileSource.stories.svelte b/components/src/maplibre/VectorTileSource/VectorTileSource.stories.svelte index c1a4922f..898b9c8a 100644 --- a/components/src/maplibre/VectorTileSource/VectorTileSource.stories.svelte +++ b/components/src/maplibre/VectorTileSource/VectorTileSource.stories.svelte @@ -13,6 +13,12 @@ title: 'Maplibre/Source/VectorTileSource', component: VectorTileSource }); + + const demoUrls = [ + 'https://demotiles.maplibre.org/tiles/tiles.json', + 'https://tiles.datenhub.net/tiles/osm/tiles.json' + ]; + let demoUrl = $state(demoUrls[1]); @@ -57,7 +63,7 @@ - +
@@ -84,6 +90,46 @@ + + + + +
+ + + + + + + + + +
+
+
+