summaryrefslogtreecommitdiff
path: root/platform/android/src/snapshotter/map_snapshotter.cpp
diff options
context:
space:
mode:
authortobrun <tobrun.van.nuland@gmail.com>2018-05-30 12:16:04 +0200
committerTobrun <tobrun@mapbox.com>2018-05-31 07:23:06 +0200
commit930d0bc17ca91176603df7f350bbff71fed8c75d (patch)
treedf0653a7c2df4e45f45695dc94413931d840677b /platform/android/src/snapshotter/map_snapshotter.cpp
parent48940939718431effcb772c349439e6e93ef63f8 (diff)
downloadqtlocation-mapboxgl-930d0bc17ca91176603df7f350bbff71fed8c75d.tar.gz
[core] [android] - optional map snapshotter camera position
Diffstat (limited to 'platform/android/src/snapshotter/map_snapshotter.cpp')
-rw-r--r--platform/android/src/snapshotter/map_snapshotter.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/android/src/snapshotter/map_snapshotter.cpp b/platform/android/src/snapshotter/map_snapshotter.cpp
index 8c064f5707..155fdf81fb 100644
--- a/platform/android/src/snapshotter/map_snapshotter.cpp
+++ b/platform/android/src/snapshotter/map_snapshotter.cpp
@@ -38,7 +38,12 @@ MapSnapshotter::MapSnapshotter(jni::JNIEnv& _env,
jFileSource = FileSource::getNativePeer(_env, _jFileSource);
auto& fileSource = mbgl::android::FileSource::getDefaultFileSource(_env, _jFileSource);
auto size = mbgl::Size { static_cast<uint32_t>(width), static_cast<uint32_t>(height) };
- auto cameraOptions = position ? CameraPosition::getCameraOptions(_env, position) : CameraOptions();
+
+ optional<mbgl::CameraOptions> cameraOptions;
+ if (position) {
+ cameraOptions = CameraPosition::getCameraOptions(_env, position);
+ }
+
optional<mbgl::LatLngBounds> bounds;
if (region) {
bounds = LatLngBounds::getLatLngBounds(_env, region);