Initial native add markers implementation

Added addMarkers to jni.ccp, exposed addMarkers in MapView, updated example using this new method
This commit is contained in:
Tobrun
2015-09-29 10:31:32 +02:00
parent 80374b3ecb
commit f43e01bb3c
4 changed files with 110 additions and 13 deletions

View File

@@ -1078,6 +1078,19 @@ public class MapView extends FrameLayout implements LocationListener {
return marker;
}
public List<Marker> addMarkers(List<Marker> markers){
long[] ids = mNativeMapView.addMarkers(markers);
Marker m;
int count = markers.size();
for (int i = 0; i < count; i++) {
m = markers.get(i);
m.setId(ids[i]);
m.setMapView(this);
mAnnotations.add(m);
}
return markers;
}
public Polyline addPolyline(PolylineOptions polylineOptions) {
Polyline polyline = polylineOptions.getPolyline();
long id = mNativeMapView.addPolyline(polyline);

View File

@@ -333,6 +333,10 @@ class NativeMapView {
return nativeAddMarker(mNativeMapViewPtr, marker);
}
public long[] addMarkers(List<Marker> markers) {
return nativeAddMarkers(mNativeMapViewPtr, markers);
}
public long addPolyline(Polyline polyline) {
return nativeAddPolyline(mNativeMapViewPtr, polyline);
}
@@ -561,6 +565,8 @@ class NativeMapView {
private native long nativeAddMarker(long nativeMapViewPtr, Marker marker);
private native long[] nativeAddMarkers(long nativeMapViewPtr, List<Marker> markers);
private native long nativeAddPolyline(long nativeMapViewPtr, Polyline polyline);
private native long nativeAddPolygon(long mNativeMapViewPtr, Polygon polygon);