diff options
Diffstat (limited to 'platform/qt')
-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 }; } |