diff options
author | Jason Wray <friedbunny@users.noreply.github.com> | 2019-03-12 14:49:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-12 14:49:49 -0700 |
commit | fb1b6010383f9991c2e95b25bf96e17ff44961d9 (patch) | |
tree | fa1c234c44bcc279d4cd96277da548cb36f5b9fb /platform/macos | |
parent | 103f86c4bca08c34c592edd481f078b7bf77cb3f (diff) | |
download | qtlocation-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/macos')
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 045a0c9f98..fa207ec187 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1132,7 +1132,7 @@ public: } - (CLLocationDirection)direction { - return *_mbglMap->getCameraOptions().bearing; + return mbgl::util::wrap(*_mbglMap->getCameraOptions().bearing, 0., 360.); } - (void)setDirection:(CLLocationDirection)direction { |