[android] deliver onMapReady only if mapboxMap is not null
This commit is contained in:
committed by
Łukasz Paczos
parent
3b9618e025
commit
a282b195d5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user