diff --git a/package.json b/package.json index 0eb6857..60efb93 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-maplibre-gl", - "version": "3.1.1", + "version": "3.1.2-alpha.1", "description": "Vue 3 plugin for maplibre-gl", "keywords": [ "vue", diff --git a/src/lib/components/sources/canvas.source.ts b/src/lib/components/sources/canvas.source.ts index 164c698..2b1f491 100644 --- a/src/lib/components/sources/canvas.source.ts +++ b/src/lib/components/sources/canvas.source.ts @@ -38,7 +38,7 @@ export default /*#__PURE__*/ defineComponent({ if (v) { source.value?.setCoordinates(v); } - }); + }, { immediate: true }); return () => [ createCommentVNode('Canvas Source'), diff --git a/src/lib/components/sources/geojson.source.ts b/src/lib/components/sources/geojson.source.ts index 84f9146..52dec89 100644 --- a/src/lib/components/sources/geojson.source.ts +++ b/src/lib/components/sources/geojson.source.ts @@ -58,7 +58,10 @@ export default /*#__PURE__*/ defineComponent({ useSource(source, props, 'geojson', sourceOpts, registry); - watch(() => props.data, v => source.value?.setData(v || { type: 'FeatureCollection', features: [] })); + watch(() => props.data, v => { + console.log('GEOJSON SOURCE', source, props.data); + source.value?.setData(v || { type: 'FeatureCollection', features: [] }); + }, { immediate: true }); return () => [ createCommentVNode('GeoJSON Source'), diff --git a/src/lib/components/sources/image.source.ts b/src/lib/components/sources/image.source.ts index 7725107..8373346 100644 --- a/src/lib/components/sources/image.source.ts +++ b/src/lib/components/sources/image.source.ts @@ -36,7 +36,7 @@ export default /*#__PURE__*/ defineComponent({ if (v) { source.value?.setCoordinates(v); } - }); + }, { immediate: true }); return () => [ createCommentVNode('Image Source'), diff --git a/src/lib/components/sources/vector.source.ts b/src/lib/components/sources/vector.source.ts index 03b6236..7097a7b 100644 --- a/src/lib/components/sources/vector.source.ts +++ b/src/lib/components/sources/vector.source.ts @@ -46,8 +46,8 @@ export default /*#__PURE__*/ defineComponent({ useSource(source, props, 'vector', sourceOpts, registry); - watch(() => props.tiles, v => source.value?.setTiles(v || [])); - watch(() => props.url, v => source.value?.setUrl(v || '')); + watch(() => props.tiles, v => source.value?.setTiles(v || []), { immediate: true }); + watch(() => props.url, v => source.value?.setUrl(v || ''), { immediate: true }); return () => [ createCommentVNode('Vector Source'), diff --git a/src/lib/components/sources/video.source.ts b/src/lib/components/sources/video.source.ts index c7dd3b9..418a107 100644 --- a/src/lib/components/sources/video.source.ts +++ b/src/lib/components/sources/video.source.ts @@ -36,7 +36,7 @@ export default /*#__PURE__*/ defineComponent({ if (v) { source.value?.setCoordinates(v); } - }); + }, { immediate: true }); return () => [ createCommentVNode('Video Source'),