summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-08-14 09:46:09 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-08-14 10:09:44 -0700
commit20ad0d51f6e6d82587e2beac34f390356409e152 (patch)
treebaaded3535d0b70c22bb54b647e43ea556c8d6d6 /ios
parentdfeb479011bbbd99de37863f5bea5fc1a8b0e02c (diff)
downloadqtlocation-mapboxgl-20ad0d51f6e6d82587e2beac34f390356409e152.tar.gz
Added UI for course tracking
Diffstat (limited to 'ios')
-rw-r--r--ios/app/MBXViewController.mm9
1 files changed, 8 insertions, 1 deletions
diff --git a/ios/app/MBXViewController.mm b/ios/app/MBXViewController.mm
index 037a6a02ca..d260f5cabb 100644
--- a/ios/app/MBXViewController.mm
+++ b/ios/app/MBXViewController.mm
@@ -319,6 +319,8 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
nextMode = MGLUserTrackingModeFollowWithHeading;
break;
case MGLUserTrackingModeFollowWithHeading:
+ nextMode = MGLUserTrackingModeFollowWithCourse;
+ break;
case MGLUserTrackingModeFollowWithCourse:
nextMode = MGLUserTrackingModeNone;
break;
@@ -404,6 +406,7 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
- (void)mapView:(__unused MGLMapView *)mapView didChangeUserTrackingMode:(MGLUserTrackingMode)mode animated:(__unused BOOL)animated
{
UIImage *newButtonImage;
+ NSString *newButtonTitle;
switch (mode) {
case MGLUserTrackingModeNone:
@@ -415,11 +418,15 @@ mbgl::Settings_NSUserDefaults *settings = nullptr;
break;
case MGLUserTrackingModeFollowWithHeading:
- case MGLUserTrackingModeFollowWithCourse:
newButtonImage = [UIImage imageNamed:@"TrackingHeadingMask.png"];
break;
+ case MGLUserTrackingModeFollowWithCourse:
+ newButtonImage = nil;
+ newButtonTitle = @"Course";
+ break;
}
+ self.navigationItem.rightBarButtonItem.title = newButtonTitle;
[UIView animateWithDuration:0.25 animations:^{
self.navigationItem.rightBarButtonItem.image = newButtonImage;
}];