summaryrefslogtreecommitdiff
path: root/platform/ios/MGLMapView.mm
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-09-04 15:51:38 -0700
committerJustin R. Miller <incanus@codesorcery.net>2015-09-07 09:22:53 -0700
commit7b931078695b6c69ceb6981f9034d7df1227a477 (patch)
treea119223ea23b479294744098b669b5531eb071e5 /platform/ios/MGLMapView.mm
parent0a172a21fdc2a87473560fd7d45f4d495d95de91 (diff)
downloadqtlocation-mapboxgl-7b931078695b6c69ceb6981f9034d7df1227a477.tar.gz
Corrected roundtripping altitude with rotation
Diffstat (limited to 'platform/ios/MGLMapView.mm')
-rw-r--r--platform/ios/MGLMapView.mm12
1 files changed, 6 insertions, 6 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index ef6ae52c33..e509b5c8d8 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -1825,7 +1825,7 @@ mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coord
double angle = -1;
if (camera.heading >= 0)
{
- angle = MGLRadiansFromDegrees(mbgl::util::wrap(-camera.heading, 0., 360.));
+ angle = MGLRadiansFromDegrees(-camera.heading);
}
double pitch = -1;
if (camera.pitch >= 0)
@@ -1851,12 +1851,12 @@ mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coord
else // portrait
{
sw = _mbglMap->latLngForProjectedMeters({
- centerMeters.northing - centerToEdge * std::cos(angle) + centerToEdge * std::cos(angle) * std::sin(pitch) / 2,
- centerMeters.easting - centerToEdge * std::sin(angle) + centerToEdge * std::sin(angle) * std::sin(pitch) / 2,
+ centerMeters.northing - centerToEdge * std::cos(-angle) + centerToEdge * std::cos(-angle) * std::sin(pitch) / 2,
+ centerMeters.easting - centerToEdge * std::sin(-angle) + centerToEdge * std::sin(-angle) * std::sin(pitch) / 2,
});
ne = _mbglMap->latLngForProjectedMeters({
- centerMeters.northing + centerToEdge * std::cos(angle) - centerToEdge * std::cos(angle) * std::sin(pitch) / 2,
- centerMeters.easting + centerToEdge * std::sin(angle) - centerToEdge * std::sin(angle) * std::sin(pitch) / 2,
+ centerMeters.northing + centerToEdge * std::cos(-angle) - centerToEdge * std::cos(-angle) * std::sin(pitch) / 2,
+ centerMeters.easting + centerToEdge * std::sin(-angle) - centerToEdge * std::sin(-angle) * std::sin(pitch) / 2,
});
}
@@ -1865,7 +1865,7 @@ mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coord
mbgl::CameraOptions options = _mbglMap->cameraForLatLngs({ sw, ne }, {});
options.center = centerLatLng;
- if (angle >= 0)
+ if (camera.heading >= 0)
{
options.angle = angle;
}