dimfeld / svelte-maplibre

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

DeckGlLayer fails to load after changing basemap #190

Open johanohly opened 2 months ago

johanohly commented 2 months ago

It is very possible that I am just doing something wrong, but using the examples' way of changing the basemap style reactively, and a DeckGlLayer inside of it, the initial loading works with the layer rendered, but when changing the style, the layer gets omitted. An error also appears in the console:

Uncaught Error: Style is not done loading.
  in DeckGlLayer.svelte
  in MapLibre.svelte
johanohly commented 2 months ago

I circumvented this by stumbling upon the diffStyleUpdates option, which not only is more efficient and smooth, but also does not even cause the Deck.gl layers to rerender. I guess I'll leave this issue open until you have time to read it and evaluate if it is even an issue on your side.

Thank you for making such an easy to use wrapper!

dimfeld commented 2 months ago

Sorry for the late response, haven't had time to work on this project for the last couple of weeks.

I'm glad you found a workaround for now though. But yes, this definitely sounds like something that should be fixed :)