wegue-oss / wegue

Template and components for webmapping applications with OpenLayers and Vue.js
BSD 2-Clause "Simplified" License
93 stars 41 forks source link

Unregister ResizeObserver for map container #397

Closed chrismayer closed 1 month ago

chrismayer commented 1 month ago

This unregisters the ResizeObserver for the map's container element, when the map is unmounted/destroyed.

Besides having a better cleanup this also removes the null pointer access within the ResizeObserver handler in the hot-reload of the dev- setup, when then WguApp.vue is changed.

chrismayer commented 1 month ago

Thanks for your review @fschmenger!

I added the check if (this.resizeObserver), not just for paranoia :wink: - it was necessary to make the tests green. Here we exactly have the situation, that no container exists. Thanks for the hint!