[android] - post invoking onMapReady to the end of the main thread message queue (#8137)

This commit is contained in:
Tobrun
2017-02-21 16:24:31 +01:00
committed by GitHub
parent a394578876
commit b49fc44498

View File

@@ -15,6 +15,7 @@ import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.CallSuper;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
@@ -1006,9 +1007,14 @@ public class MapView extends FrameLayout {
public void onMapChanged(@MapChange int change) {
if (change == DID_FINISH_LOADING_STYLE && initialLoad) {
initialLoad = false;
mapboxMap.onPreMapReady();
onMapReady();
mapboxMap.onPostMapReady();
new Handler().post(new Runnable() {
@Override
public void run() {
mapboxMap.onPreMapReady();
onMapReady();
mapboxMap.onPostMapReady();
}
});
} else if (change == REGION_IS_CHANGING || change == REGION_DID_CHANGE || change == DID_FINISH_LOADING_MAP) {
mapboxMap.onUpdate();
}