diff options
author | Łukasz Paczos <lukas.paczos@gmail.com> | 2018-11-02 13:04:23 +0100 |
---|---|---|
committer | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-11-02 20:09:49 +0100 |
commit | a282b195d54918a7107444303a515448f7ed7614 (patch) | |
tree | ea4c78c95456ca09ed843229beadddb292284f43 /platform/android/MapboxGLAndroidSDK/src/main/java/com | |
parent | 3b9618e0253c28b280bdbf9d7bd064a909c8c86b (diff) | |
download | qtlocation-mapboxgl-a282b195d54918a7107444303a515448f7ed7614.tar.gz |
[android] deliver onMapReady only if mapboxMap is not null
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java index 3b1352e153..3d56e134f6 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java @@ -951,7 +951,8 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback { */ @UiThread public void getMapAsync(final @NonNull OnMapReadyCallback callback) { - if (mapCallback.isInitialLoad()) { + if (mapCallback.isInitialLoad() || mapboxMap == null) { + // Add callback to the list only if the style hasn't loaded, or the drawing surface isn't ready mapCallback.addOnMapReadyCallback(callback); } else { callback.onMapReady(mapboxMap); |