Gotcha...I suppose you don't get any event when geoMap source changes right? Are you setting this? If you are you could use a separate stateful variable that you use to trigger the effect
Comments
Log in with your Bluesky account to leave a comment
As a matter of fact I just realized there’s indeed a callback ‘SourceAddedCallback’ that I could use to react to source initialization.
Btw it’s mapbox-gl I’m working with. I’m not super familiar with it yet
Comments
If I do this:
geoMap = new GeoMap();
geoMap.addSource(…);
sourceAdded = true;
And then use sourceAdded in the effect, it works exactly as expected! No need for the snapshot anymore
Btw it’s mapbox-gl I’m working with. I’m not super familiar with it yet
https://svelte.dev/playground/6fd552d6918e43fdbd513b064fe49a0b?version=5.19.3