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
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
We have several methods that are currently crashing because map.setStyleURL is async. For instance addLayer, addClass, isLoaded and several others. We should have a signal (MapChangeDidFinishLoadingStyle?) emitted right after MapContext::loadStyleJSON.
On Android for instance MapChangeDidFinishLoadingMap is used to indicate that the style was loaded as a whole but we need something to indicate that the style JSON arrived (and the style object was created). Otherwise we might ended up rendering a partial state and later add a custom layer or class.
This new signal would be better implemented after we get rid of the context thread (#2909) because we can safely call view.notifyMapChange from MapContext::loadStyleJSON after that.
Finally, we should maybe throw an runtime exception when calling the methods that depend on a style when the style json is not yet loaded.
I agree with the utility of a notification for this event -- it's style.load in gl-js. I'm less keen on expanding the MapChange enumeration, for reasons detailed in #6383, though I wouldn't block a PR for this on the full refactor suggested there.
We have several methods that are currently crashing because
map.setStyleURL
is async. For instanceaddLayer
,addClass
,isLoaded
and several others. We should have a signal (MapChangeDidFinishLoadingStyle
?) emitted right afterMapContext::loadStyleJSON
.On Android for instance
MapChangeDidFinishLoadingMap
is used to indicate that the style was loaded as a whole but we need something to indicate that the style JSON arrived (and the style object was created). Otherwise we might ended up rendering a partial state and later add a custom layer or class.This new signal would be better implemented after we get rid of the context thread (#2909) because we can safely call
view.notifyMapChange
fromMapContext::loadStyleJSON
after that.Finally, we should maybe throw an runtime exception when calling the methods that depend on a style when the style json is not yet loaded.
/cc @brunoabinader @jfirebaugh
The text was updated successfully, but these errors were encountered: