diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-02-28 10:02:35 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2019-03-01 10:56:25 +0200 |
commit | 623d28cb44633205972979e8419aff497b9b5475 (patch) | |
tree | 308035952a5c15a5e642af9e7685b5cf5a173f85 | |
parent | 67a9dc35bf0c0113d429161be2c125e75981fb5d (diff) | |
download | qtlocation-mapboxgl-623d28cb44633205972979e8419aff497b9b5475.tar.gz |
[qt] Cleanup QMapboxGL::coordinateZoomForBounds()
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index 203a1a5341..35ff7f7c29 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -1246,21 +1246,8 @@ QMapbox::CoordinateZoom QMapboxGL::coordinateZoomForBounds(const QMapbox::Coordi double newBearing, double newPitch) { - // FIXME: mbgl::Map::cameraForLatLngBounds should - // take bearing and pitch as input too, so this - // hack won't be needed. - double currentBearing = bearing(); - double currentPitch = pitch(); - - setBearing(newBearing); - setPitch(newPitch); - auto bounds = mbgl::LatLngBounds::hull(mbgl::LatLng { sw.first, sw.second }, mbgl::LatLng { ne.first, ne.second }); - mbgl::CameraOptions camera = d_ptr->mapObj->cameraForLatLngBounds(bounds, d_ptr->margins); - - setBearing(currentBearing); - setPitch(currentPitch); - + mbgl::CameraOptions camera = d_ptr->mapObj->cameraForLatLngBounds(bounds, d_ptr->margins, newBearing, newPitch); return {{ (*camera.center).latitude(), (*camera.center).longitude() }, *camera.zoom }; } |