[android] fire onMapReady only after style is loaded (#6046)

This commit is contained in:
Ivo van Dongen
2016-09-20 15:10:33 +02:00
committed by GitHub
parent 1e8f9c75ca
commit aa47680a02

View File

@@ -452,7 +452,7 @@ public class MapView extends FrameLayout {
addOnMapChangedListener(new OnMapChangedListener() {
@Override
public void onMapChanged(@MapChange int change) {
if (change == WILL_START_RENDERING_MAP && initialLoad) {
if (change == DID_FINISH_LOADING_STYLE && initialLoad) {
initialLoad = false;
reloadIcons();
reloadMarkers();
@@ -2866,7 +2866,8 @@ public class MapView extends FrameLayout {
DID_FINISH_RENDERING_FRAME_FULLY_RENDERED,
WILL_START_RENDERING_MAP,
DID_FINISH_RENDERING_MAP,
DID_FINISH_RENDERING_MAP_FULLY_RENDERED
DID_FINISH_RENDERING_MAP_FULLY_RENDERED,
DID_FINISH_LOADING_STYLE
})
@Retention(RetentionPolicy.SOURCE)
public @interface MapChange {
@@ -3017,6 +3018,16 @@ public class MapView extends FrameLayout {
*/
public static final int DID_FINISH_RENDERING_MAP_FULLY_RENDERED = 13;
/**
* <p>
* This {@link MapChange} is triggered when a style is loaded
* </p>
*
* @see MapView.OnMapChangedListener
*/
public static final int DID_FINISH_LOADING_STYLE = 14;
/**
* Interface definition for a callback to be invoked when the displayed map view changes.
*