ghettovoice / vuelayers

Web map Vue components with the power of OpenLayers
https://vuelayers.github.io/
MIT License
683 stars 229 forks source link

unmount maps #525

Closed fernanduandrade closed 1 year ago

fernanduandrade commented 1 year ago

Hello! What's the best practice for umountings the maps?

ghettovoice commented 1 year ago

Hello @fernanduandrade , unmounting is done by Vue automatically via beforeDestroy hook. But if you need to make it programmatically, you can use

mapCmp.$destroy() - std Vue method to unmount and destroy component
mapCmp.unmount() - vuelayers method to unmount only ol/Map object.
fernanduandrade commented 1 year ago

thankyou u'r the best. I'm not used to use the beforeDestroy hook, that helps a lot