summaryrefslogtreecommitdiff
path: root/platform/ios/src/MGLMapView.mm
diff options
context:
space:
mode:
authorJason Wray <friedbunny@users.noreply.github.com>2019-03-12 14:49:49 -0700
committerGitHub <noreply@github.com>2019-03-12 14:49:49 -0700
commitfb1b6010383f9991c2e95b25bf96e17ff44961d9 (patch)
treefa1c234c44bcc279d4cd96277da548cb36f5b9fb /platform/ios/src/MGLMapView.mm
parent103f86c4bca08c34c592edd481f078b7bf77cb3f (diff)
downloadqtlocation-mapboxgl-fb1b6010383f9991c2e95b25bf96e17ff44961d9.tar.gz
[darwin] Fix MGLMapView.direction wrapping
Re-adds the 0-to-360° wrapping for MGLMapView.direction. Without this wrapping, we’d get ±180° from core, which results in invalid CLLocationDirection for the negative half of the rotational spectrum.
Diffstat (limited to 'platform/ios/src/MGLMapView.mm')
-rw-r--r--platform/ios/src/MGLMapView.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index f19f1c8661..c45f436c33 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -3431,7 +3431,7 @@ public:
- (CLLocationDirection)direction
{
- return *self.mbglMap.getCameraOptions().bearing;
+ return mbgl::util::wrap(*self.mbglMap.getCameraOptions().bearing, 0., 360.);
}
- (void)setDirection:(CLLocationDirection)direction animated:(BOOL)animated