summaryrefslogtreecommitdiff
path: root/platform/android/src/style/sources/geojson_source.hpp
diff options
context:
space:
mode:
authorWilhelm Berg <wb@BergWerk-GIS.at>2018-09-12 15:07:57 +0200
committerWilhelm Berg <wb@BergWerk-GIS.at>2018-09-12 15:07:57 +0200
commit98b34cb0dbf5c50d7f319724c93021418140b15f (patch)
tree11cd51f86b5c672dda6bfe087f40f77df1553971 /platform/android/src/style/sources/geojson_source.hpp
parentee17d79f9420eb859303d977955454dacc470db6 (diff)
parent079ba0209ed383c15123902f0810e658c2b0abf4 (diff)
downloadqtlocation-mapboxgl-98b34cb0dbf5c50d7f319724c93021418140b15f.tar.gz
Merge remote-tracking branch 'origin' into bwg-vs2017upstream/bwg-vs2017
# Conflicts: # cmake/mason-dependencies.cmake
Diffstat (limited to 'platform/android/src/style/sources/geojson_source.hpp')
-rw-r--r--platform/android/src/style/sources/geojson_source.hpp36
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);