diff options
Diffstat (limited to 'platform/android/src/style/sources/geojson_source.hpp')
-rw-r--r-- | platform/android/src/style/sources/geojson_source.hpp | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/platform/android/src/style/sources/geojson_source.hpp b/platform/android/src/style/sources/geojson_source.hpp index 24ea3c73f8..20e8b6873b 100644 --- a/platform/android/src/style/sources/geojson_source.hpp +++ b/platform/android/src/style/sources/geojson_source.hpp @@ -16,7 +16,7 @@ struct FeatureConverter { void convertJson(std::shared_ptr<std::string>, ActorRef<Callback>); template <class JNIType> - void convertObject(jni::Object<JNIType>, ActorRef<Callback>); + void convertObject(std::shared_ptr<jni::Global<jni::Object<JNIType>, jni::EnvAttachingDeleter>>, ActorRef<Callback>); }; struct Update { @@ -30,43 +30,35 @@ struct Update { class GeoJSONSource : public Source { public: - + using SuperTag = Source; static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/GeoJsonSource"; }; - static jni::Class<GeoJSONSource> javaClass; - static void registerNative(jni::JNIEnv&); - GeoJSONSource(jni::JNIEnv&, jni::String, jni::Object<>); - + GeoJSONSource(jni::JNIEnv&, const jni::String&, const jni::Object<>&); GeoJSONSource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&); - ~GeoJSONSource(); - void setGeoJSONString(jni::JNIEnv&, jni::String); - - void setFeatureCollection(jni::JNIEnv&, jni::Object<geojson::FeatureCollection>); - - void setFeature(jni::JNIEnv&, jni::Object<geojson::Feature>); - - void setGeometry(jni::JNIEnv&, jni::Object<geojson::Geometry>); - - void setURL(jni::JNIEnv&, jni::String); +private: + void setGeoJSONString(jni::JNIEnv&, const jni::String&); + void setFeatureCollection(jni::JNIEnv&, const jni::Object<geojson::FeatureCollection>&); + void setFeature(jni::JNIEnv&, const jni::Object<geojson::Feature>&); + void setGeometry(jni::JNIEnv&, const jni::Object<geojson::Geometry>&); + void setURL(jni::JNIEnv&, const jni::String&); - jni::String getURL(jni::JNIEnv&); + jni::Local<jni::Array<jni::Object<geojson::Feature>>> querySourceFeatures(jni::JNIEnv&, + const jni::Array<jni::Object<>>&); - jni::Array<jni::Object<geojson::Feature>> querySourceFeatures(jni::JNIEnv&, - jni::Array<jni::Object<>> jfilter); + jni::Local<jni::String> getURL(jni::JNIEnv&); -private: - jni::Object<Source> createJavaPeer(jni::JNIEnv&); + jni::Local<jni::Object<Source>> createJavaPeer(jni::JNIEnv&); std::unique_ptr<Update> awaitingUpdate; std::unique_ptr<Update> update; std::shared_ptr<ThreadPool> threadPool; std::unique_ptr<Actor<FeatureConverter>> converter; template <class JNIType> - void setCollectionAsync(jni::JNIEnv&, jni::Object<JNIType>); + void setCollectionAsync(jni::JNIEnv&, const jni::Object<JNIType>&); void setAsync(Update::Converter); |