working on pollens #1716
This commit is contained in:
@@ -216,8 +216,8 @@ public class MapView extends SurfaceView {
|
||||
|
||||
public Marker addMarker(MarkerOptions markerOptions) {
|
||||
Marker marker = markerOptions.getMarker();
|
||||
Long markerId = mNativeMapView.addMarker(marker);
|
||||
marker.setId(markerId); // the annotation needs to know its id
|
||||
Long id = mNativeMapView.addMarker(marker);
|
||||
marker.setId(id); // the annotation needs to know its id
|
||||
marker.setMapView(this); // the annotation needs to know which map view it is in
|
||||
annotations.add(marker);
|
||||
return marker;
|
||||
@@ -225,7 +225,10 @@ public class MapView extends SurfaceView {
|
||||
|
||||
public Polyline addPolyline(PolylineOptions polylineOptions) {
|
||||
Polyline polyline = polylineOptions.getPolyline();
|
||||
|
||||
Long id = mNativeMapView.addPolyline(polyline);
|
||||
polyline.setId(id);
|
||||
polyline.setMapView(this);
|
||||
annotations.add(polyline);
|
||||
return polyline;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.graphics.PointF;
|
||||
import android.view.Surface;
|
||||
|
||||
import com.mapbox.mapboxgl.annotations.Marker;
|
||||
import com.mapbox.mapboxgl.annotations.Polyline;
|
||||
import com.mapbox.mapboxgl.geometry.LatLng;
|
||||
import com.mapbox.mapboxgl.geometry.LatLngZoom;
|
||||
import com.mapbox.mapboxgl.geometry.ProjectedMeters;
|
||||
@@ -219,6 +220,11 @@ class NativeMapView {
|
||||
return nativeAddMarker(mNativeMapViewPtr, latLng);
|
||||
}
|
||||
|
||||
public long addPolyline(Polyline polyline) {
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void removeAnnotation(long id) {
|
||||
nativeRemoveAnnotation(mNativeMapViewPtr, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user