[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:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user