diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-11-12 17:19:34 +0200 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-11-12 10:46:50 -0800 |
commit | 8b76f00d8cc617abb492c368fc6887183147402b (patch) | |
tree | 584e43e8147ec69be9097a0c52f4309fe639593a /platform/ios/MGLMapView.mm | |
parent | 6748b6155e0bdb61aa33ecfe467711ce7e1189c3 (diff) | |
download | qtlocation-mapboxgl-8b76f00d8cc617abb492c368fc6887183147402b.tar.gz |
[core] PrecisionPoint is now a vec2<double>
We could reuse all the operators defined in vec2<>, including operator
bool() that checks if the contained values are !NaN.
Diffstat (limited to 'platform/ios/MGLMapView.mm')
-rw-r--r-- | platform/ios/MGLMapView.mm | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index a194f4653f..cf68c9ae35 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -1039,7 +1039,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) CGFloat newRadians = radians + velocity * duration * 0.1; CGFloat newDegrees = MGLDegreesFromRadians(newRadians) * -1; - _mbglMap->setBearing(newDegrees, secondsAsDuration(duration)); + _mbglMap->setBearing(newDegrees, mbgl::Duration(secondsAsDuration(duration))); _mbglMap->setGestureInProgress(false); @@ -1555,9 +1555,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) - (void)resetNorthAnimated:(BOOL)animated { - CGFloat duration = (animated ? MGLAnimationDuration : 0); - - _mbglMap->setBearing(0, secondsAsDuration(duration)); + _mbglMap->setBearing(0, mbgl::Duration(secondsAsDuration(animated ? MGLAnimationDuration : 0))); } - (void)resetPosition @@ -1789,10 +1787,10 @@ mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coord self.userTrackingMode = MGLUserTrackingModeFollow; } - CGFloat duration = (animated ? MGLAnimationDuration : 0); + CGFloat duration = animated ? MGLAnimationDuration : 0; + + _mbglMap->setBearing(direction, mbgl::Duration(secondsAsDuration(duration))); - _mbglMap->setBearing(direction, secondsAsDuration(duration)); - if (animated) { __weak MGLMapView *weakSelf = self; @@ -2820,7 +2818,7 @@ CLLocationCoordinate2D MGLLocationCoordinate2DFromLatLng(mbgl::LatLng latLng) if (headingDirection >= 0 && self.userTrackingMode == MGLUserTrackingModeFollowWithHeading) { - _mbglMap->setBearing(headingDirection, secondsAsDuration(MGLAnimationDuration)); + _mbglMap->setBearing(headingDirection, mbgl::Duration(secondsAsDuration(MGLAnimationDuration))); } } |