From 9040e4419ebd9caed5c2a0c711709724428488f8 Mon Sep 17 00:00:00 2001 From: hvangeffen Date: Mon, 16 Dec 2024 14:51:04 +0100 Subject: [PATCH] Use getLayer and getSource id to remain active on basemap change --- src/components/wms/OverlayLayer.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/wms/OverlayLayer.vue b/src/components/wms/OverlayLayer.vue index 40a35d96..6a11397f 100644 --- a/src/components/wms/OverlayLayer.vue +++ b/src/components/wms/OverlayLayer.vue @@ -23,6 +23,7 @@ import type { OverlayLocation } from '@/lib/topology/componentSettings' import { fetchLocationSetAsGeoJson } from '@/lib/topology' import { configManager } from '@/services/application-config' import { asyncComputed } from '@vueuse/core' +import { getLayerId, getSourceId } from '@/lib/map' interface Props { overlay: OverlayLocation @@ -30,8 +31,8 @@ interface Props { const props = defineProps() -const sourceId = `overlay-source-${props.overlay.id}` -const layerId = `overlay-layer-${props.overlay.id}` +const sourceId = getSourceId(`overlay-${props.overlay.id}`) +const layerId = getLayerId(`overlay-${props.overlay.id}`) const baseUrl = configManager.get('VITE_FEWS_WEBSERVICES_URL') const geojson = asyncComputed(