diff options
author | Łukasz Paczos <lukasz.paczos@mapbox.com> | 2018-03-08 15:55:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-08 15:55:47 +0100 |
commit | dfdfbc09902cdb592d217d3e264f736ce5217926 (patch) | |
tree | 43b293d726ae5ae0542da5ad9bf072cee6c7677b /platform/android/src/native_map_view.cpp | |
parent | ea525fd08a69e2a840f3d14291b23027a3747986 (diff) | |
download | qtlocation-mapboxgl-dfdfbc09902cdb592d217d3e264f736ce5217926.tar.gz |
[android] calculating camera's LatLng for bounds without map padding (#11410)
Diffstat (limited to 'platform/android/src/native_map_view.cpp')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index 3bd46631a0..eecb76213b 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -288,13 +288,15 @@ void NativeMapView::setLatLng(jni::JNIEnv&, jni::jdouble latitude, jni::jdouble map->setLatLng(mbgl::LatLng(latitude, longitude), insets, mbgl::AnimationOptions{mbgl::Milliseconds(duration)}); } -jni::Object<CameraPosition> NativeMapView::getCameraForLatLngBounds(jni::JNIEnv& env, jni::Object<LatLngBounds> jBounds) { - return CameraPosition::New(env, map->cameraForLatLngBounds(mbgl::android::LatLngBounds::getLatLngBounds(env, jBounds), insets)); +jni::Object<CameraPosition> NativeMapView::getCameraForLatLngBounds(jni::JNIEnv& env, jni::Object<LatLngBounds> jBounds, double top, double left, double bottom, double right) { + mbgl::EdgeInsets padding = {top, left, bottom, right}; + return CameraPosition::New(env, map->cameraForLatLngBounds(mbgl::android::LatLngBounds::getLatLngBounds(env, jBounds), padding)); } -jni::Object<CameraPosition> NativeMapView::getCameraForGeometry(jni::JNIEnv& env, jni::Object<geojson::Geometry> jGeometry, double bearing) { +jni::Object<CameraPosition> NativeMapView::getCameraForGeometry(jni::JNIEnv& env, jni::Object<geojson::Geometry> jGeometry, double bearing, double top, double left, double bottom, double right) { auto geometry = geojson::Geometry::convert(env, jGeometry); - return CameraPosition::New(env, map->cameraForGeometry(geometry, insets, bearing)); + mbgl::EdgeInsets padding = {top, left, bottom, right}; + return CameraPosition::New(env, map->cameraForGeometry(geometry, padding, bearing)); } void NativeMapView::setReachability(jni::JNIEnv&, jni::jboolean reachable) { |