diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java index 8978d4be48..9482afaa26 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java @@ -1,5 +1,6 @@ package com.mapbox.mapboxsdk.annotations; +import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.View; @@ -84,11 +85,8 @@ public final class Marker extends Annotation { /** * Do not use this method. Used internally by the SDK. */ - public InfoWindow showInfoWindow() { - if (getMapView() == null) { - return null; - } - + public InfoWindow showInfoWindow(@NonNull MapView mapView) { + setMapView(mapView); MapView.InfoWindowAdapter infoWindowAdapter = getMapView().getInfoWindowAdapter(); if (infoWindowAdapter != null) { // end developer is using a custom InfoWindowAdapter @@ -100,7 +98,7 @@ public final class Marker extends Annotation { } } - getInfoWindow().adaptDefaultMarker(this); + getInfoWindow().adaptDefaultMarker(this, mapView); return showInfoWindow(getInfoWindow()); } |