dimfeld / svelte-maplibre

Svelte bindings for the MapLibre mapping library
https://svelte-maplibre.vercel.app
MIT License
283 stars 34 forks source link

Removing Markers and LineLayer #152

Closed MrTalon63 closed 2 months ago

MrTalon63 commented 2 months ago

I'm pretty new to Svelte and MapLibre, so my knowledge is limited. While I got creating Markers and Lines pretty easily, I can't figure out how do I clear out markers no longer required or all of them from my map.

dimfeld commented 2 months ago

You just use normal Svelte template control flow statements like #if and #each. When the component gets removed then it will removes its corresponding elements from the map.