You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where a instance is given to OlMap vue component, it attaches handles for all events even if when are not used by the consumer, it causes overhead emitting events with no purpose, in the worst case, if an instance is used in more than once can cause multiple events to fire with undefined behaviour.
Mount a Map.OlMap component a condition and with a given 'instance' not controlled by vue3-openlayers.
Change the condition to force a remount of the Vue component, calling the "on" method in all event types of OpenLayers Map.
Repeat.
Expected behaviour
Handler functions added from Map are properly disconnected when Map.OlMap Vue component is dismounted, if an event is not used, do not call to the on method in the map instance. This logic can be applied to vue3-openlayers controlled "Map" instances.
Screenshots
Current code:
Crappy solution:
Platform
All platforms
Additional context
I saw in "src/composables/useOpenLayersEvents.ts" has a good function to attach that logic, I posted this issue because I cannot run locally the project and I doesn't found a guide to do so.
Thank you.
The text was updated successfully, but these errors were encountered:
Describe the bug
Where a instance is given to OlMap vue component, it attaches handles for all events even if when are not used by the consumer, it causes overhead emitting events with no purpose, in the worst case, if an instance is used in more than once can cause multiple events to fire with undefined behaviour.
Affected version(s)
+-- ol-contextmenu@5.5.0
+-- ol-ext@4.0.25
+-- ol@10.3.1
+-- vue@3.5.13
`-- vue3-openlayers@11.3.0
To Reproduce
Steps to reproduce the behaviour:
Expected behaviour
Handler functions added from Map are properly disconnected when Map.OlMap Vue component is dismounted, if an event is not used, do not call to the on method in the map instance. This logic can be applied to vue3-openlayers controlled "Map" instances.
Screenshots
Current code:
Crappy solution:
Platform
Additional context
I saw in "src/composables/useOpenLayersEvents.ts" has a good function to attach that logic, I posted this issue because I cannot run locally the project and I doesn't found a guide to do so.
Thank you.
The text was updated successfully, but these errors were encountered: