summaryrefslogtreecommitdiff
path: root/platform/android/src/snapshotter/map_snapshot.cpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-10-27 20:08:47 +0300
committerIvo van Dongen <info@ivovandongen.nl>2017-10-31 10:05:40 +0200
commit1c4b6a78328f0f39992fd39df68a9b609c32c059 (patch)
tree59a11f7ce237b192b52b98bbf6cea14817a5d018 /platform/android/src/snapshotter/map_snapshot.cpp
parentd65676db51b14f7d11d447428c65a00c999b4d7c (diff)
downloadqtlocation-mapboxgl-1c4b6a78328f0f39992fd39df68a9b609c32c059.tar.gz
[android] map snapshotter - expose attributionsupstream/ivd-mapsnapshotter-extensions
Diffstat (limited to 'platform/android/src/snapshotter/map_snapshot.cpp')
-rw-r--r--platform/android/src/snapshotter/map_snapshot.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/android/src/snapshotter/map_snapshot.cpp b/platform/android/src/snapshotter/map_snapshot.cpp
index 09e83bbb8a..843a8a487a 100644
--- a/platform/android/src/snapshotter/map_snapshot.cpp
+++ b/platform/android/src/snapshotter/map_snapshot.cpp
@@ -1,6 +1,7 @@
#include "map_snapshot.hpp"
#include "../bitmap.hpp"
+#include "../jni/collection.hpp"
#include <memory>
@@ -25,14 +26,15 @@ jni::Object<PointF> MapSnapshot::pixelForLatLng(jni::JNIEnv& env, jni::Object<La
jni::Object<MapSnapshot> MapSnapshot::New(JNIEnv& env,
PremultipliedImage&& image,
float pixelRatio,
+ std::vector<std::string> attributions,
mbgl::MapSnapshotter::PointForFn pointForFn) {
// Create the bitmap
auto bitmap = Bitmap::CreateBitmap(env, std::move(image));
// Create the Mapsnapshot peers
- static auto constructor = javaClass.GetConstructor<jni::jlong, jni::Object<Bitmap>>(env);
+ static auto constructor = javaClass.GetConstructor<jni::jlong, jni::Object<Bitmap>, jni::Array<jni::String>>(env);
auto nativePeer = std::make_unique<MapSnapshot>(pixelRatio, pointForFn);
- return javaClass.New(env, constructor, reinterpret_cast<jlong>(nativePeer.release()), bitmap);
+ return javaClass.New(env, constructor, reinterpret_cast<jlong>(nativePeer.release()), bitmap, jni::Make<jni::Array<jni::String>>(env, attributions));
}
jni::Class<MapSnapshot> MapSnapshot::javaClass;