-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layers mount on map in unpredictable manner #101
Comments
Underscore in property name means that it only for internal use of mapbox itself, and we shouldn't relay on this. |
If that was the case, the callback would never have been triggered, app will never load layers that waits until map load, right? |
Sorry i mean .loaded() of course |
The issue is: some layers sometimes doesn't load on map. See this test stage case I've caught

This error happends 'cause we were trying to add source to map that wasn't done loading.
We've fixed that in
willMount
lifecycle hook for both generic and bivariate layers. But here it was caused bywillSourceUpdate
hook.So the natural solution for me was to move fix one step higher, something like that
But that wouldn't work - map won't mount layers. Now the interesting part - let's log our
waitMapEvent
helperWhen mounting fails following console logs can be seen

This matters hugely, because
map.on('load', callback)
will not run, if it was setted after the map was actually loaded.And if we need to rely on map readyness (and we do) we need to rely on
map._loaded
propertyIn other words example above could be working with on line fix
The text was updated successfully, but these errors were encountered: