summaryrefslogtreecommitdiff
path: root/platform/android/src/style/sources/custom_geometry_source.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/style/sources/custom_geometry_source.hpp')
-rw-r--r--platform/android/src/style/sources/custom_geometry_source.hpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/platform/android/src/style/sources/custom_geometry_source.hpp b/platform/android/src/style/sources/custom_geometry_source.hpp
new file mode 100644
index 0000000000..1dc1c07b4f
--- /dev/null
+++ b/platform/android/src/style/sources/custom_geometry_source.hpp
@@ -0,0 +1,47 @@
+#pragma once
+
+#include "source.hpp"
+#include <mbgl/style/sources/custom_geometry_source.hpp>
+#include <mbgl/util/geojson.hpp>
+#include <mbgl/tile/tile_id.hpp>
+#include "../../geojson/geometry.hpp"
+#include "../../geojson/feature.hpp"
+#include "../../geojson/feature_collection.hpp"
+#include "../../geometry/lat_lng_bounds.hpp"
+#include <jni/jni.hpp>
+
+namespace mbgl {
+namespace android {
+
+class CustomGeometrySource : public Source {
+public:
+
+ static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/sources/CustomGeometrySource"; };
+
+ static jni::Class<CustomGeometrySource> javaClass;
+
+ static void registerNative(jni::JNIEnv&);
+
+ CustomGeometrySource(jni::JNIEnv&, jni::String, jni::Object<>);
+
+ CustomGeometrySource(jni::JNIEnv&, mbgl::style::Source&, AndroidRendererFrontend&);
+
+ ~CustomGeometrySource();
+
+ void fetchTile(const mbgl::CanonicalTileID& tileID);
+ void cancelTile(const mbgl::CanonicalTileID& tileID);
+ void setTileData(jni::JNIEnv& env, jni::jint z, jni::jint x, jni::jint y, jni::Object<geojson::FeatureCollection> jf);
+
+ void invalidateTile(jni::JNIEnv& env, jni::jint z, jni::jint x, jni::jint y);
+ void invalidateBounds(jni::JNIEnv& env, jni::Object<LatLngBounds> bounds);
+
+ jni::Array<jni::Object<geojson::Feature>> querySourceFeatures(jni::JNIEnv&,
+ jni::Array<jni::Object<>> );
+
+private:
+ jni::Object<Source> createJavaPeer(jni::JNIEnv&);
+
+}; // class CustomGeometrySource
+
+} // namespace android
+} // namespace mbgl