[android] - do not update marker while creating (#6314)

* [android] - do not update marker while creating, add activity to prevent regression

* [core] - add asserts to incorrect usage of update and remove annotations api

* [android] - fix marker tests
This commit is contained in:
Tobrun
2016-09-20 03:03:49 +02:00
committed by John Firebaugh
parent 37cb2bd756
commit 72e3d6906d
8 changed files with 239 additions and 18 deletions

View File

@@ -49,6 +49,13 @@ public class Marker extends Annotation {
title = baseMarkerViewOptions.title;
}
Marker(LatLng position, Icon icon, String title, String snippet) {
this.position = position;
this.icon = icon;
this.title = title;
this.snippet = snippet;
}
public LatLng getPosition() {
return position;
}

View File

@@ -22,14 +22,10 @@ import com.mapbox.mapboxsdk.geometry.LatLng;
*/
public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions> implements Parcelable {
private Marker marker;
public MarkerOptions() {
marker = new Marker();
}
protected MarkerOptions(Parcel in) {
marker = new Marker();
position((LatLng) in.readParcelable(LatLng.class.getClassLoader()));
snippet(in.readString());
title(in.readString());
@@ -75,11 +71,7 @@ public final class MarkerOptions extends BaseMarkerOptions<Marker, MarkerOptions
throw new InvalidMarkerPositionException();
}
marker.setPosition(position);
marker.setSnippet(snippet);
marker.setTitle(title);
marker.setIcon(icon);
return marker;
return new Marker(position, icon, title, snippet);
}
public LatLng getPosition() {