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 was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
To improve general map initialization time and more specificly map loading time when their isn't an internet connection. We should decouple OnMapReady invocation from the style finished loading event. OnMapReady should be called when the map is ready to render and we should provide a separate callback for when the style has finished loading. This change will require public API changes and will fit in well with the prospoed Style.java refactors in #9338.
@tobrun if users are using OnMapReady as a hook for adding new sources/layers to the map via runtime styling, would the change proposed here cause issues where dynamically added layers would be lost after a remote style was finished loading? (Related: #10947)
Yes, without any additional changes to the api that would result in not having those sources/layers added to the finished loaded style. eg. clustering is not showing up anymore:
For this reason I would like to include #9338 and refactor the API as:
mapView.getMapAsync(map -> {
// we get callback once the native lib has loadedmap.setStyle(Style.MAPBOX_STREETS, style -> {
// we get callback once the style has loadedstyle.addSource(newGeoJsonSource(MARKER_SOURCE, markers));
style.addLayer(
newSymbolLayer(MARKER_LAYER, MARKER_SOURCE)
);
});
The users won't be able to add sources/layers until the style has finished loading. Above api change would also help with implementing #10947.
Reacted by Anand Eng-Thakker, Łukasz Paczos, femski and Tamás Szincsák
Activity
anandthakker commentedon Jun 28, 2018
@tobrun if users are using
OnMapReadyas a hook for adding new sources/layers to the map via runtime styling, would the change proposed here cause issues where dynamically added layers would be lost after a remote style was finished loading? (Related: #10947)tobrun commentedon Jun 29, 2018
Yes, without any additional changes to the api that would result in not having those sources/layers added to the finished loaded style. eg. clustering is not showing up anymore:
For this reason I would like to include #9338 and refactor the API as:
The users won't be able to add sources/layers until the style has finished loading. Above api change would also help with implementing #10947.
tobrun commentedon Dec 10, 2018
done with #13484