Skip to content

Commit

Permalink
working on pollens mapbox#1716
Browse files Browse the repository at this point in the history
  • Loading branch information
hallahan committed Jul 15, 2015
1 parent 82e88a6 commit 297190e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,19 @@ private void initialize(Context context, AttributeSet attrs) {

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;
}

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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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;
Expand Down Expand Up @@ -219,6 +220,11 @@ public long addMarker(Marker marker) {
return nativeAddMarker(mNativeMapViewPtr, latLng);
}

public long addPolyline(Polyline polyline) {

return -1;
}

public void removeAnnotation(long id) {
nativeRemoveAnnotation(mNativeMapViewPtr, id);
}
Expand Down

0 comments on commit 297190e

Please sign in to comment.