summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2019-02-28 10:02:35 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2019-03-04 14:45:32 +0200
commit362231e2d02333e301b0ec70c85e5ac4e7741bf3 (patch)
tree7559eba3b25d5b59638ee856cf1e8ee2cb7c86b4
parent2ce70f7335445155b6cde9066b01eb24c1101b3d (diff)
downloadqtlocation-mapboxgl-362231e2d02333e301b0ec70c85e5ac4e7741bf3.tar.gz
[qt] Cleanup QMapboxGL::coordinateZoomForBounds()
-rw-r--r--platform/qt/src/qmapboxgl.cpp15
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 };
}