diff --git a/library/composables/useMapInstance.js b/library/composables/useMapInstance.js index de637e368..850aeca12 100644 --- a/library/composables/useMapInstance.js +++ b/library/composables/useMapInstance.js @@ -798,7 +798,11 @@ export function useMapInstance({ const w = typeof window !== 'undefined' ? window : null if (w && w.__doxaLogoOwner === map.value) w.__doxaLogoOwner = null } catch (_) { /* a locked-down window is not a reason to skip the teardown below */ } + const dead = map.value map.value.remove() + // The container kept __doxaMap after teardown, holding the whole dead map (GL context, sources, + // tiles) reachable from the DOM. Clear it only if it is still this instance's. + try { if (containerRef && containerRef.value && containerRef.value.__doxaMap === dead) containerRef.value.__doxaMap = null } catch (_) {} map.value = null isMapReady.value = false }