diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPointFeature.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPointFeature.java new file mode 100644 index 00000000000..1e219ba5f23 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPointFeature.java @@ -0,0 +1,28 @@ +package com.mapbox.mapboxsdk.annotations; + +import java.util.Map; + +public class MultiPointFeature extends MultiPoint implements Feature { + + private long featureId; + private Map attributes; + + public MultiPointFeature() { + } + + @Override + public long getFeatureId() { + return featureId; + } + + @Override + public Map getAttributes() { + return attributes; + } + + @Override + public Object getAttribute(String key) { + return attributes.get(key); + } + +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPolygonFeature.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPolygonFeature.java new file mode 100644 index 00000000000..21d3359f8e0 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPolygonFeature.java @@ -0,0 +1,28 @@ +package com.mapbox.mapboxsdk.annotations; + +import java.util.List; +import java.util.Map; + +public class MultiPolygonFeature extends MultiPolygon implements Feature{ + private long featureId; + private Map attributes; + + public MultiPolygonFeature(List polygonList) { + super(polygonList); + } + + @Override + public long getFeatureId() { + return featureId; + } + + @Override + public Map getAttributes() { + return attributes; + } + + @Override + public Object getAttribute(String key) { + return attributes.get(key); + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPolylineFeature.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPolylineFeature.java new file mode 100644 index 00000000000..75086227297 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/MultiPolylineFeature.java @@ -0,0 +1,28 @@ +package com.mapbox.mapboxsdk.annotations; + +import java.util.List; +import java.util.Map; + +public class MultiPolylineFeature extends MultiPolyline implements Feature { + private long featureId; + private Map attributes; + + public MultiPolylineFeature(List polylineList) { + super(polylineList); + } + + @Override + public long getFeatureId() { + return featureId; + } + + @Override + public Map getAttributes() { + return attributes; + } + + @Override + public Object getAttribute(String key) { + return attributes.get(key); + } +} diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/ShapeCollectionFeature.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/ShapeCollectionFeature.java new file mode 100644 index 00000000000..4a2199e86e2 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/annotations/ShapeCollectionFeature.java @@ -0,0 +1,28 @@ +package com.mapbox.mapboxsdk.annotations; + +import java.util.List; +import java.util.Map; + +public class ShapeCollectionFeature extends ShapeCollection implements Feature { + private long featureId; + private Map attributes; + + public ShapeCollectionFeature(List shapeList) { + super(shapeList); + } + + @Override + public long getFeatureId() { + return featureId; + } + + @Override + public Map getAttributes() { + return attributes; + } + + @Override + public Object getAttribute(String key) { + return attributes.get(key); + } +} diff --git a/platform/android/src/jni.cpp b/platform/android/src/jni.cpp index af5301175d2..9c270af45ec 100755 --- a/platform/android/src/jni.cpp +++ b/platform/android/src/jni.cpp @@ -163,9 +163,24 @@ jni::jmethodID* offlineRegionDeleteOnErrorId = nullptr; jni::jclass* polygonFeatureClass = nullptr; jni::jmethodID* polygonFeatureConstructorId = nullptr; +//jni::jclass* multiPolygonFeatureClass = nullptr; +//jni::jmethodID* multiPolygonFeatureConstructorId = nullptr; + jni::jclass* polylineFeatureClass = nullptr; jni::jmethodID* polylineFeatureConstructorId = nullptr; +//jni::jclass* multiPolylineFeatureClass = nullptr; +//jni::jmethodID* multiPolylineFeatureConstructorId = nullptr; + +jni::jclass* pointFeatureClass = nullptr; +jni::jmethodID* pointFeatureConstructorId = nullptr; + +//jni::jclass* multiPointFeatureClass = nullptr; +//jni::jmethodID* multiPointFeatureConstructorId = nullptr; + +//jni::jclass* shapeCollectionFeatureClass = nullptr; +//jni::jmethodID* shapeCollectionFeatureConstructorId = nullptr; + jni::jclass* featureWrapperClass = nullptr; jni::jmethodID* featureWrapperConstructorId = nullptr; jni::jmethodID* featureWrapperAddId = nullptr; @@ -1672,10 +1687,26 @@ extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved) { polygonFeatureClass = jni::NewGlobalRef(env, polygonFeatureClass).release(); polygonFeatureConstructorId = &jni::GetMethodID(env, *polygonFeatureClass, "", "()V"); + //multiPolygonFeatureClass = &jni::FindClass(env, "com/mapbox/mapboxsdk/annotations/MultiPolygonFeature"); + //multiPolygonFeatureClass = jni::NewGlobalRef(env, multiPolygonFeatureClass).release(); + //multiPolygonFeatureConstructorId = &jni::GetMethodID(env, *multiPolygonFeatureClass, "", "()V"); + polylineFeatureClass = &jni::FindClass(env, "com/mapbox/mapboxsdk/annotations/PolylineFeature"); polylineFeatureClass = jni::NewGlobalRef(env, polylineFeatureClass).release(); polylineFeatureConstructorId = &jni::GetMethodID(env, *polylineFeatureClass, "", "()V"); + //multiPolylineFeatureClass = &jni::FindClass(env, "com/mapbox/mapboxsdk/annotations/MultiPolylineFeature"); + //multiPolylineFeatureClass = jni::NewGlobalRef(env, multiPolylineFeatureClass).release(); + //multiPolylineFeatureConstructorId = &jni::GetMethodID(env, *multiPolylineFeatureClass, "", "()V"); + + pointFeatureClass = &jni::FindClass(env, "com/mapbox/mapboxsdk/annotations/PointFeature"); + pointFeatureClass = jni::NewGlobalRef(env, pointFeatureClass).release(); + pointFeatureConstructorId = &jni::GetMethodID(env, *pointFeatureClass, "", "()V"); + + //multiPointFeatureClass = &jni::FindClass(env, "com/mapbox/mapboxsdk/annotations/MultiPointFeature"); + //multiPointFeatureClass = jni::NewGlobalRef(env, multiPointFeatureClass).release(); + //multiPointFeatureConstructorId = &jni::GetMethodID(env, *multiPointFeatureClass, "", "()V"); + featureWrapperClass = &jni::FindClass(env, "com/mapbox/mapboxsdk/annotations/FeatureWrapper"); featureWrapperClass = jni::NewGlobalRef(env, featureWrapperClass).release(); featureWrapperConstructorId = &jni::GetMethodID(env, *featureWrapperClass, "", "()V");;