diff --git a/src/components/ol/Map.vue b/src/components/ol/Map.vue index 86dc6e5e..4ab75298 100644 --- a/src/components/ol/Map.vue +++ b/src/components/ol/Map.vue @@ -78,6 +78,7 @@ export default { me.map.updateSize(); }); resizeObserver.observe(container); + this.resizeObserver = resizeObserver; // add tabIndex attribute to the map's container, so it gets focusable. // Otherwise the OL keyboard navigation won't work, see keyboardEventTarget @@ -98,6 +99,11 @@ export default { }, 200); }, destroyed () { + // unregister resizing of the map + if (this.resizeObserver) { + this.resizeObserver.disconnect(); + } + // Send the event 'ol-map-unmounted' with the OL map as payload WguEventBus.$emit('ol-map-unmounted', this.map);