summaryrefslogtreecommitdiff
path: root/platform/android/src/snapshotter/map_snapshot.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/src/snapshotter/map_snapshot.hpp')
-rw-r--r--platform/android/src/snapshotter/map_snapshot.hpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/platform/android/src/snapshotter/map_snapshot.hpp b/platform/android/src/snapshotter/map_snapshot.hpp
new file mode 100644
index 0000000000..4673dcd16e
--- /dev/null
+++ b/platform/android/src/snapshotter/map_snapshot.hpp
@@ -0,0 +1,46 @@
+#pragma once
+
+#include <mbgl/map/map_snapshotter.hpp>
+
+#include <jni/jni.hpp>
+
+#include "../geometry/lat_lng.hpp"
+#include "../graphics/pointf.hpp"
+
+#include <vector>
+#include <string>
+
+namespace mbgl {
+namespace android {
+
+class MapSnapshot {
+public:
+
+ using PointForFn = mbgl::MapSnapshotter::PointForFn;
+
+ static constexpr auto Name() { return "com/mapbox/mapboxsdk/snapshotter/MapSnapshot"; };
+
+ static void registerNative(jni::JNIEnv&);
+
+ static jni::Object<MapSnapshot> New(JNIEnv& env,
+ PremultipliedImage&& image,
+ float pixelRatio,
+ std::vector<std::string> attributions,
+ bool showLogo,
+ PointForFn pointForFn);
+
+ MapSnapshot(jni::JNIEnv&) {};
+ MapSnapshot(float pixelRatio, PointForFn);
+ ~MapSnapshot();
+
+ jni::Object<PointF> pixelForLatLng(jni::JNIEnv&, jni::Object<LatLng>);
+
+private:
+ static jni::Class<MapSnapshot> javaClass;
+
+ float pixelRatio;
+ mbgl::MapSnapshotter::PointForFn pointForFn;
+};
+
+} // namespace android
+} // namespace mbgl \ No newline at end of file