diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-10-09 16:54:32 +0300 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-10-31 19:52:08 +0200 |
commit | dde1a922919770fa009c90ff0525b69488e30bb1 (patch) | |
tree | b1510eabd6a7ea99e27a462a38f463510510f479 /platform/android/src/snapshotter/map_snapshot.hpp | |
parent | 87b735aaf71557b157a092a8025e6126ed2d8611 (diff) | |
download | qtlocation-mapboxgl-dde1a922919770fa009c90ff0525b69488e30bb1.tar.gz |
[android] map snapshotter - wrap snapshot in native peer for access to the pointFor functionality
Diffstat (limited to 'platform/android/src/snapshotter/map_snapshot.hpp')
-rw-r--r-- | platform/android/src/snapshotter/map_snapshot.hpp | 41 |
1 files changed, 41 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..6d60d49728 --- /dev/null +++ b/platform/android/src/snapshotter/map_snapshot.hpp @@ -0,0 +1,41 @@ +#pragma once + +#include <mbgl/map/map_snapshotter.hpp> + +#include <jni/jni.hpp> + +#include "../geometry/lat_lng.hpp" +#include "../graphics/pointf.hpp" + +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, + 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 |