From f8349862ffac4fa832c9d6a2438e7e051fe8944b Mon Sep 17 00:00:00 2001 From: ingalls Date: Wed, 2 Oct 2024 10:42:23 -0400 Subject: [PATCH] Check if source exists --- api/web/src/stores/map.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/web/src/stores/map.ts b/api/web/src/stores/map.ts index 27d514324..9cbedc8f3 100644 --- a/api/web/src/stores/map.ts +++ b/api/web/src/stores/map.ts @@ -116,7 +116,7 @@ export const useMapStore = defineStore('cloudtak', { // TODO: Convert to overlay addTerrain: async function(): void { const basemaps = await this.listTerrain(); - if (basemaps.items.length) { + if (basemaps.items.length && !this.map.getSource('-2')) { this.map.addSource('-2', { type: 'raster-dem', url: String(stdurl(`/api/basemap/${basemaps.items[0].id}/tiles?token=${localStorage.token}`)),