MelihAltintas / vue3-openlayers

Web map Vue 3.x components with the power of OpenLayers
https://vue3openlayers.netlify.app/
MIT License
629 stars 120 forks source link

refactor: unify source handling #354

Closed d-koppenhagen closed 1 month ago

d-koppenhagen commented 1 month ago

Is your feature request related to a problem? Please describe. Currently each Source component has some common code which will create the corresponding OpenLayers source, watch for any changes, applies / removes the source. The code therefore is mostly duplicated in each component but sometimes a bit different.

Describe the solution you'd like To simplify component setup (as well for possible plugin providers), the base code should be extracted in a separate composable. Also the usage of computed / shallowRef for the created sources should be unified. A shallowRef should be good enough and it prevents the re-creation of the source instance on side effects which could lead into performance issues or issues with not cleaned up sold sources.

Describe alternatives you've considered none.

Additional context This will possibly introduce a breaking change.