From 930d0bc17ca91176603df7f350bbff71fed8c75d Mon Sep 17 00:00:00 2001 From: tobrun Date: Wed, 30 May 2018 12:16:04 +0200 Subject: [core] [android] - optional map snapshotter camera position --- platform/android/src/snapshotter/map_snapshotter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'platform/android/src') 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(width), static_cast(height) }; - auto cameraOptions = position ? CameraPosition::getCameraOptions(_env, position) : CameraOptions(); + + optional cameraOptions; + if (position) { + cameraOptions = CameraPosition::getCameraOptions(_env, position); + } + optional bounds; if (region) { bounds = LatLngBounds::getLatLngBounds(_env, region); -- cgit v1.2.1