Skip to content

Commit

Permalink
JNI is compiling with the polyline object mapbox#1716
Browse files Browse the repository at this point in the history
  • Loading branch information
hallahan committed Jul 15, 2015
1 parent 6335aec commit 441c84c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions android/cpp/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,15 @@ jlong JNICALL nativeAddMarker(JNIEnv *env, jobject obj, jlong nativeMapViewPtr,
return (jlong) nativeMapView->getMap().addPointAnnotation(mbgl::PointAnnotation(mbgl::LatLng(latitude, longitude), std::string("default_marker")));
}

jlong JNICALL nativeAddPolyline(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jobject polyline) {
mbgl::Log::Debug(mbgl::Event::JNI, "nativeAddPolyline");
assert(nativeMapViewPtr != 0);
// NativeMapView *nativeMapView = reinterpret_cast<NativeMapView *>(nativeMapViewPtr);


return -1;
}

void JNICALL nativeRemoveAnnotation(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jlong annotationId) {
mbgl::Log::Debug(mbgl::Event::JNI, "nativeRemoveAnnotation");
assert(nativeMapViewPtr != 0);
Expand Down Expand Up @@ -1007,6 +1016,8 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) {
reinterpret_cast<void *>(&nativeSetLatLng)},
{"nativeAddMarker", "(JLcom/mapbox/mapboxgl/geometry/LatLng;)J",
reinterpret_cast<void *>(&nativeAddMarker)},
{"nativeAddPolyline", "(JLcom/mapbox/mapboxgl/annotations/Polyline;)J",
reinterpret_cast<void *>(&nativeAddPolyline)},
{"nativeRemoveAnnotation", "(JJ)V", reinterpret_cast<void *>(&nativeRemoveAnnotation)},
{"nativeGetLatLng", "(J)Lcom/mapbox/mapboxgl/geometry/LatLng;",
reinterpret_cast<void *>(&nativeGetLatLng)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ public long addMarker(Marker marker) {
}

public long addPolyline(Polyline polyline) {

return -1;
return nativeAddPolyline(mNativeMapViewPtr, polyline);
}

public void removeAnnotation(long id) {
Expand Down Expand Up @@ -463,6 +462,8 @@ private native void nativeSetLatLng(long nativeMapViewPtr, LatLng latLng,

private native long nativeAddMarker(long nativeMapViewPtr, LatLng latLng);

private native long nativeAddPolyline(long nativeMapViewPtr, Polyline polyline);

private native void nativeRemoveAnnotation(long nativeMapViewPtr, long id);

private native LatLng nativeGetLatLng(long nativeMapViewPtr);
Expand Down

0 comments on commit 441c84c

Please sign in to comment.