summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/Marker.java
diff options
context:
space:
mode:
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.java7
1 files changed, 7 insertions, 0 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 d0e5777602..a99a7d08da 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
@@ -31,12 +31,15 @@ public class Marker extends Annotation {
@Keep
private LatLng position;
private String snippet;
+ @Nullable
private Icon icon;
//Redundantly stored for JNI access
+ @Nullable
@Keep
private String iconId;
private String title;
+ @Nullable
private InfoWindow infoWindow;
private boolean infoWindowShown;
@@ -161,6 +164,7 @@ public class Marker extends Annotation {
*
* @return The {@link Icon} the marker is using.
*/
+ @Nullable
public Icon getIcon() {
return icon;
}
@@ -212,6 +216,7 @@ public class Marker extends Annotation {
* @param mapView The hosting map view.
* @return The info window that was shown.
*/
+ @Nullable
public InfoWindow showInfoWindow(@NonNull MapboxMap mapboxMap, @NonNull MapView mapView) {
setMapboxMap(mapboxMap);
setMapView(mapView);
@@ -233,12 +238,14 @@ public class Marker extends Annotation {
return showInfoWindow(infoWindow, mapView);
}
+ @NonNull
private InfoWindow showInfoWindow(InfoWindow iw, MapView mapView) {
iw.open(mapView, this, getPosition(), rightOffsetPixels, topOffsetPixels);
infoWindowShown = true;
return iw;
}
+ @Nullable
private InfoWindow getInfoWindow(@NonNull MapView mapView) {
if (infoWindow == null && mapView.getContext() != null) {
infoWindow = new InfoWindow(mapView, R.layout.mapbox_infowindow_content, getMapboxMap());