summaryrefslogtreecommitdiff
path: root/platform/macos/src
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-01-24 08:29:46 -0800
committerGitHub <noreply@github.com>2017-01-24 08:29:46 -0800
commit35e062d72cde411e8a9a36ef74cbe527d31e945b (patch)
tree74a668219e317fd7fd36710034e540d3e5df3a90 /platform/macos/src
parentb32c17119e5b046aab796a29e321759095a0959b (diff)
downloadqtlocation-mapboxgl-35e062d72cde411e8a9a36ef74cbe527d31e945b.tar.gz
[ios, macos] Wrap camera heading (#7724)
* [ios, macos] Fixed negative camera heading when facing northwest * [ios] Corrected counterclockwise rotation test
Diffstat (limited to 'platform/macos/src')
-rw-r--r--platform/macos/src/MGLMapView.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm
index 3deb7db577..2b0d5f4bc8 100644
--- a/platform/macos/src/MGLMapView.mm
+++ b/platform/macos/src/MGLMapView.mm
@@ -1249,7 +1249,7 @@ public:
- (MGLMapCamera *)cameraForCameraOptions:(const mbgl::CameraOptions &)cameraOptions {
CLLocationCoordinate2D centerCoordinate = MGLLocationCoordinate2DFromLatLng(cameraOptions.center ? *cameraOptions.center : _mbglMap->getLatLng());
double zoomLevel = cameraOptions.zoom ? *cameraOptions.zoom : self.zoomLevel;
- CLLocationDirection direction = cameraOptions.angle ? -MGLDegreesFromRadians(*cameraOptions.angle) : self.direction;
+ CLLocationDirection direction = cameraOptions.angle ? mbgl::util::wrap(-MGLDegreesFromRadians(*cameraOptions.angle), 0., 360.) : self.direction;
CGFloat pitch = cameraOptions.pitch ? MGLDegreesFromRadians(*cameraOptions.pitch) : _mbglMap->getPitch();
CLLocationDistance altitude = MGLAltitudeForZoomLevel(zoomLevel, pitch,
centerCoordinate.latitude,