#2535 - Re exposing sprite field level access, but putting a null check in MarkerOptions to help guard it.

This commit is contained in:
Brad Leege
2015-10-07 11:00:06 -05:00
parent 6fbb57e6ee
commit 3a1f62e6b9
2 changed files with 5 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ public class Marker extends Annotation {
LatLng position;
private float rotation;
private String snippet;
private String sprite = "default_marker";
String sprite = "default_marker";
private String title;
private InfoWindow infoWindow = null;

View File

@@ -1,6 +1,7 @@
package com.mapbox.mapboxsdk.annotations;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.mapbox.mapboxsdk.geometry.LatLng;
public class MarkerOptions extends AnnotationOptions {
@@ -98,7 +99,9 @@ public class MarkerOptions extends AnnotationOptions {
}
public MarkerOptions sprite(@Nullable String sprite) {
((Marker)annotation).setSprite(sprite);
if (!TextUtils.isEmpty(sprite)) {
((Marker)annotation).sprite = sprite;
}
return this;
}