From f911cf310702f1840c49334d63a814b52cbc8005 Mon Sep 17 00:00:00 2001 From: Nicholas Hallahan Date: Thu, 16 Jul 2015 10:24:27 -0700 Subject: [PATCH] successful shape annotation #1716 --- android/cpp/jni.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index fcf53ad0c..a7098f620 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 shapes; + shapes.emplace_back(mbgl::AnnotationSegments {{ segment }}, shapeProperties); - - return (jlong) nativeMapView->getMap().addShapeAnnotation(mbgl::ShapeAnnotation(segment, shapeProperties)); + std::vector 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) {