diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-10-26 13:25:09 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-10-26 16:25:29 -0700 |
commit | 8c159117171fd14270889ad5acab8a54e3ce1c28 (patch) | |
tree | 9646db1b91826b2fa83cadaa44241baf500f915a | |
parent | 064d8b9aa8e8d468069d5b670dde1bd873496b2e (diff) | |
download | qtlocation-mapboxgl-8c159117171fd14270889ad5acab8a54e3ce1c28.tar.gz |
[ios, macos] Removed extraneous radian-degree conversions
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 12 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 77ae541c43..bcd1e07ef8 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3027,7 +3027,7 @@ public: cameraOptions.zoom = zoomLevel; if (direction >= 0) { - cameraOptions.angle = MGLRadiansFromDegrees(-direction); + cameraOptions.angle = direction; } mbgl::AnimationOptions animationOptions; @@ -3197,7 +3197,7 @@ public: mbgl::CameraOptions cameraOptions = _mbglMap->cameraForLatLngs(latLngs, padding); if (direction >= 0) { - cameraOptions.angle = MGLRadiansFromDegrees(-direction); + cameraOptions.angle = direction; } mbgl::AnimationOptions animationOptions; @@ -3476,8 +3476,8 @@ public: { CLLocationCoordinate2D centerCoordinate = MGLLocationCoordinate2DFromLatLng(cameraOptions.center ? *cameraOptions.center : _mbglMap->getLatLng()); double zoomLevel = cameraOptions.zoom ? *cameraOptions.zoom : self.zoomLevel; - CLLocationDirection direction = cameraOptions.angle ? mbgl::util::wrap(-MGLDegreesFromRadians(*cameraOptions.angle), 0., 360.) : self.direction; - CGFloat pitch = cameraOptions.pitch ? MGLDegreesFromRadians(*cameraOptions.pitch) : _mbglMap->getPitch(); + CLLocationDirection direction = cameraOptions.angle ? mbgl::util::wrap(*cameraOptions.angle, 0., 360.) : self.direction; + CGFloat pitch = cameraOptions.pitch ? *cameraOptions.pitch : _mbglMap->getPitch(); CLLocationDistance altitude = MGLAltitudeForZoomLevel(zoomLevel, pitch, centerCoordinate.latitude, self.frame.size); return [MGLMapCamera cameraLookingAtCenterCoordinate:centerCoordinate altitude:altitude pitch:pitch heading:direction]; } @@ -3497,11 +3497,11 @@ public: self.frame.size); if (camera.heading >= 0) { - options.angle = MGLRadiansFromDegrees(-camera.heading); + options.angle = camera.heading; } if (camera.pitch >= 0) { - options.pitch = MGLRadiansFromDegrees(camera.pitch); + options.pitch = camera.pitch; } return options; } diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 215d2b680e..6fdc679789 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1221,10 +1221,10 @@ public: camera.centerCoordinate.latitude, self.frame.size); if (camera.heading >= 0) { - options.angle = MGLRadiansFromDegrees(-camera.heading); + options.angle = -camera.heading; } if (camera.pitch >= 0) { - options.pitch = MGLRadiansFromDegrees(camera.pitch); + options.pitch = camera.pitch; } return options; } @@ -1317,8 +1317,8 @@ 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 ? mbgl::util::wrap(-MGLDegreesFromRadians(*cameraOptions.angle), 0., 360.) : self.direction; - CGFloat pitch = cameraOptions.pitch ? MGLDegreesFromRadians(*cameraOptions.pitch) : _mbglMap->getPitch(); + CLLocationDirection direction = cameraOptions.angle ? mbgl::util::wrap(*cameraOptions.angle, 0., 360.) : self.direction; + CGFloat pitch = cameraOptions.pitch ? *cameraOptions.pitch : _mbglMap->getPitch(); CLLocationDistance altitude = MGLAltitudeForZoomLevel(zoomLevel, pitch, centerCoordinate.latitude, self.frame.size); |