You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to add our own layers. If we use style.load, our layers are rendered faster, because load event is fired at the end:
styledata
style.load <-- we CAN render our layers here (at least it works and looks faster than "load" event)
styledata
styledata
load
Okay, we can use load event here and render them with some delay. At least it works.
But it worse if we want to render same layers after style is changed. Please, use Ruler Control and switch style by Style Control. We want to preserve the same Ruler state. Events log:
styledata
style.load
styledata
styledata
Only style.load event is fired once. How we can use public styledata event here without some setTimeout hacks to draw layers again?
Thanks ❤️
The text was updated successfully, but these errors were encountered:
Also, if you use Language Control to modify style, styledata event is called. But this action doesn't clear our own layers (like after Style Control) and we don't want here to redraw them. So by using styledata event in this case, we will have redundant redraw.
korywka
changed the title
Events: so when the style changed and ready to draw?
Events: so when the style loaded and ready to draw?
Sep 17, 2019
Try using the event "idle" and if it isn't triggered use panTo to recenter.
That way you are triggering 'idle' event to listen
This is the most reliable workaround so far for me.
For now we have
style.load
event which is not public.We are supposed to use
styledata
.Lets take this example: https://bravecow.github.io/mapbox-gl-controls/
style.load
, our layers are rendered faster, becauseload
event is fired at the end:Okay, we can use
load
event here and render them with some delay. At least it works.Only
style.load
event is fired once. How we can use publicstyledata
event here without somesetTimeout
hacks to draw layers again?Thanks ❤️
The text was updated successfully, but these errors were encountered: