diff options
Diffstat (limited to 'platform/android/src/geojson/feature_collection.cpp')
-rw-r--r-- | platform/android/src/geojson/feature_collection.cpp | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/platform/android/src/geojson/feature_collection.cpp b/platform/android/src/geojson/feature_collection.cpp deleted file mode 100644 index f90d5226b7..0000000000 --- a/platform/android/src/geojson/feature_collection.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "feature_collection.hpp" - -#include "feature.hpp" - -namespace mbgl { -namespace android { -namespace geojson { - -mbgl::FeatureCollection FeatureCollection::convert(jni::JNIEnv& env, const jni::Object<FeatureCollection>& jCollection) { - auto collection = mbgl::FeatureCollection(); - - if (jCollection) { - auto jFeatureList = FeatureCollection::features(env, jCollection); - auto jFeatures = java::util::List::toArray<Feature>(env, jFeatureList); - auto size = size_t(jFeatures.Length(env)); - collection.reserve(size); - - for (size_t i = 0; i < size; i++) { - collection.push_back(Feature::convert(env, jFeatures.Get(env, i))); - } - } - return collection; -} - -jni::Local<jni::Object<java::util::List>> FeatureCollection::features(jni::JNIEnv& env, const jni::Object<FeatureCollection>& jCollection) { - static auto& javaClass = jni::Class<FeatureCollection>::Singleton(env); - static auto method = javaClass.GetMethod<jni::Object<java::util::List> ()>(env, "features"); - return jCollection.Call(env, method); -} - -void FeatureCollection::registerNative(jni::JNIEnv& env) { - jni::Class<FeatureCollection>::Singleton(env); -} - -} // namespace geojson -} // namespace android -} // namespace mbgl
\ No newline at end of file |