summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-08-13 10:00:05 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-08-14 10:09:43 -0700
commitdfeb479011bbbd99de37863f5bea5fc1a8b0e02c (patch)
tree844105e4548c5dee74c8938b0802f8ee117d3679 /ios
parent2f316878448d0056b5c4ced6ce0819349eaf466e (diff)
downloadqtlocation-mapboxgl-dfeb479011bbbd99de37863f5bea5fc1a8b0e02c.tar.gz
MGLUserTrackingModeFollowWithCourse
Added course-tracking. However, rotation has to happen atomically without animation until #1834 is fixed. Fixes #1605.
Diffstat (limited to 'ios')
-rw-r--r--ios/app/MBXViewController.mm25
1 files changed, 14 insertions, 11 deletions
diff --git a/ios/app/MBXViewController.mm b/ios/app/MBXViewController.mm
index e11f7eea5c..037a6a02ca 100644
--- a/ios/app/MBXViewController.mm
+++ b/ios/app/MBXViewController.mm
@@ -310,18 +310,20 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
- (void)locateUser
{
- if (self.mapView.userTrackingMode == MGLUserTrackingModeNone)
- {
- self.mapView.userTrackingMode = MGLUserTrackingModeFollow;
- }
- else if (self.mapView.userTrackingMode == MGLUserTrackingModeFollow)
- {
- self.mapView.userTrackingMode = MGLUserTrackingModeFollowWithHeading;
- }
- else
- {
- self.mapView.userTrackingMode = MGLUserTrackingModeNone;
+ MGLUserTrackingMode nextMode;
+ switch (self.mapView.userTrackingMode) {
+ case MGLUserTrackingModeNone:
+ nextMode = MGLUserTrackingModeFollow;
+ break;
+ case MGLUserTrackingModeFollow:
+ nextMode = MGLUserTrackingModeFollowWithHeading;
+ break;
+ case MGLUserTrackingModeFollowWithHeading:
+ case MGLUserTrackingModeFollowWithCourse:
+ nextMode = MGLUserTrackingModeNone;
+ break;
}
+ self.mapView.userTrackingMode = nextMode;
}
#pragma mark - Destruction
@@ -413,6 +415,7 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
break;
case MGLUserTrackingModeFollowWithHeading:
+ case MGLUserTrackingModeFollowWithCourse:
newButtonImage = [UIImage imageNamed:@"TrackingHeadingMask.png"];
break;
}