summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Hallahan <nick@theoutpost.io>2015-07-16 10:24:27 -0700
committerNicholas Hallahan <nick@theoutpost.io>2015-07-16 10:24:27 -0700
commitf911cf310702f1840c49334d63a814b52cbc8005 (patch)
tree93d8d6fe3195c771e11462158373a60626a0a98c
parentaebd4196ac345a1eb49f0c9e2f8ec2215cad4ad7 (diff)
downloadqtlocation-mapboxgl-f911cf310702f1840c49334d63a814b52cbc8005.tar.gz
successful shape annotation #1716
-rw-r--r--android/cpp/jni.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp
index fcf53ad0c9..a7098f620b 100644
--- a/android/cpp/jni.cpp
+++ b/android/cpp/jni.cpp
@@ -557,9 +557,12 @@ jlong JNICALL nativeAddPolyline(JNIEnv *env, jobject obj, jlong nativeMapViewPtr
segment.push_back(mbgl::LatLng(latitude, longitude));
}
+ std::vector<mbgl::ShapeAnnotation> shapes;
+ shapes.emplace_back(mbgl::AnnotationSegments {{ segment }}, shapeProperties);
-
- return (jlong) nativeMapView->getMap().addShapeAnnotation(mbgl::ShapeAnnotation(segment, shapeProperties));
+ std::vector<uint32_t> shapeAnnotationIDs = nativeMapView->getMap().addShapeAnnotations(shapes);
+ uint32_t id = shapeAnnotationIDs.at(0);
+ return (jlong) id;
}
void JNICALL nativeRemoveAnnotation(JNIEnv *env, jobject obj, jlong nativeMapViewPtr, jlong annotationId) {