Closed dimfeld closed 3 months ago
Looks like Layer.svelte only handles the sourceLayer prop on instantiation, and it needs to change to update the layer reactively when that prop changes.
Might work to just edit the style? https://stackoverflow.com/questions/70109527/mapbox-change-source-property
Worst case we can tear down the layer and recreate it but I'm hoping that won't be necessary.
Unfortunately this just doesn't seem to be supported. I recommend putting a {#key}
template construct (https://svelte.dev/docs/logic-blocks#key) around any layer components that may need to change their sourceLayer at runtime.