maplibre / maplibre-gl-js

MapLibre GL JS - Interactive vector tile maps in the browser
https://maplibre.org/maplibre-gl-js/docs/
Other
6.6k stars 709 forks source link

Need an event status identifier push, when I use setStyle(), change the layer #4757

Open sundayswaimmer opened 1 month ago

sundayswaimmer commented 1 month ago

Now there is a scene in the project, when the user switches the map style, we need to redraw some layers on the map. The problem is that none of the event events in maplibregl can tell me that the new layer has been loaded and I can redraw now. I can only deal with this problem by setting a timer. It makes me feel very insecure.

HarelM commented 1 month ago

Thanks for taking the time to open this issue. Please provide more details. The above statement is very vague and hard to understand, it misses context, motivation, and other relevant information. There is the style.load event which you can use and idle event too.