diff --git a/components/src/maplibre/GeoJSONSource/GeoJSONSource.stories.svelte b/components/src/maplibre/GeoJSONSource/GeoJSONSource.stories.svelte index 26031d4d..50dec4e6 100644 --- a/components/src/maplibre/GeoJSONSource/GeoJSONSource.stories.svelte +++ b/components/src/maplibre/GeoJSONSource/GeoJSONSource.stories.svelte @@ -40,6 +40,7 @@ diff --git a/components/src/maplibre/Source/MapSource.svelte b/components/src/maplibre/Source/MapSource.svelte index fbcfa014..8791900a 100644 --- a/components/src/maplibre/Source/MapSource.svelte +++ b/components/src/maplibre/Source/MapSource.svelte @@ -3,7 +3,7 @@ import { type Map, type SourceSpecification } from 'maplibre-gl'; import { getMapContext, createSourceContext } from '../context.svelte.js'; - type Source = maplibregl.VectorTileSource; + type Source = maplibregl.VectorTileSource | maplibregl.GeoJSONSource; interface MapSourceProps { id: string; @@ -35,7 +35,10 @@ // 2. Do extra stuff with the source object $effect(() => { - if (source) { + if (source && sourceSpec.type === 'geojson') { + if (!firstRun) { + source.setData(sourceSpec.data); + } } }); diff --git a/components/src/maplibre/VectorLayer/VectorLayer.stories.svelte b/components/src/maplibre/VectorLayer/VectorLayer.stories.svelte index bf3104ee..74464abf 100644 --- a/components/src/maplibre/VectorLayer/VectorLayer.stories.svelte +++ b/components/src/maplibre/VectorLayer/VectorLayer.stories.svelte @@ -24,9 +24,9 @@ /> any; - onmousemove: (e: MapLayerMouseEvent) => any; - onmouseleave: (e: MapLayerMouseEvent) => any; + onclick?: (e: MapLayerMouseEvent) => any; + onmousemove?: (e: MapLayerMouseEvent) => any; + onmouseleave?: (e: MapLayerMouseEvent) => any; } const { id, sourceId, sourceLayer, visible = true, - placeBelow = 'label-place-capital', + placeBelow = 'label-place-major-city', type, paint, layout, diff --git a/package-lock.json b/package-lock.json index 2a02aed8..830f6ed2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5501,15 +5501,6 @@ "@types/geojson": "*" } }, - "node_modules/@types/trusted-types": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", - "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, "node_modules/@types/unist": { "version": "2.0.11", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", @@ -18500,22 +18491,6 @@ "node": ">=18" } }, - "node_modules/playwright/node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "peer": true, - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/please-upgrade-node": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", @@ -21533,21 +21508,6 @@ } } }, - "node_modules/svelte-check/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/svelte-check/node_modules/readdirp": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", @@ -23620,21 +23580,6 @@ "dev": true, "license": "ISC" }, - "node_modules/yaml": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", - "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", - "dev": true, - "license": "ISC", - "optional": true, - "peer": true, - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - } - }, "node_modules/yargs": { "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",