summaryrefslogtreecommitdiff
path: root/platform/android/src/style/sources/geojson_source.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/style/sources/geojson_source.hpp')
-rw-r--r--platform/android/src/style/sources/geojson_source.hpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/platform/android/src/style/sources/geojson_source.hpp b/platform/android/src/style/sources/geojson_source.hpp
index e737e41924..e506191ceb 100644
--- a/platform/android/src/style/sources/geojson_source.hpp
+++ b/platform/android/src/style/sources/geojson_source.hpp
@@ -11,22 +11,28 @@
namespace mbgl {
namespace android {
-using Callback = std::function<void (GeoJSON)>;
+using GeoJSONDataCallback = std::function<void(std::shared_ptr<style::GeoJSONData>)>;
-struct FeatureConverter {
- void convertJson(std::shared_ptr<std::string>, ActorRef<Callback>);
+class FeatureConverter {
+public:
+ explicit FeatureConverter(style::GeoJSONOptions options_) : options(std::move(options_)) {}
+ void convertJson(std::shared_ptr<std::string>, ActorRef<GeoJSONDataCallback>);
template <class JNIType>
- void convertObject(std::shared_ptr<jni::Global<jni::Object<JNIType>, jni::EnvAttachingDeleter>>, ActorRef<Callback>);
+ void convertObject(std::shared_ptr<jni::Global<jni::Object<JNIType>, jni::EnvAttachingDeleter>>,
+ ActorRef<GeoJSONDataCallback>);
+
+private:
+ style::GeoJSONOptions options;
};
struct Update {
- using Converter = std::function<void (ActorRef<Callback>)>;
+ using Converter = std::function<void(ActorRef<GeoJSONDataCallback>)>;
Converter converterFn;
- std::unique_ptr<Actor<Callback>> callback;
+ std::unique_ptr<Actor<GeoJSONDataCallback>> callback;
- Update(Converter, std::unique_ptr<Actor<Callback>>);
+ Update(Converter, std::unique_ptr<Actor<GeoJSONDataCallback>>);
};
class GeoJSONSource : public Source {