diff options
Diffstat (limited to 'platform/ios/demo/Examples/ObjectiveC/UserTrackingModesExample.m')
-rw-r--r-- | platform/ios/demo/Examples/ObjectiveC/UserTrackingModesExample.m | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/platform/ios/demo/Examples/ObjectiveC/UserTrackingModesExample.m b/platform/ios/demo/Examples/ObjectiveC/UserTrackingModesExample.m new file mode 100644 index 0000000000..621727128a --- /dev/null +++ b/platform/ios/demo/Examples/ObjectiveC/UserTrackingModesExample.m @@ -0,0 +1,25 @@ +#import "UserTrackingModesExample.h" +@import Mapbox; + +NSString *const MBXExampleUserTrackingModes = @"UserTrackingModesExample"; + +@implementation UserTrackingModesExample + +- (void)viewDidLoad { + [super viewDidLoad]; + + MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:[MGLStyle darkStyleURLWithVersion:9]]; + mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + + mapView.userTrackingMode = MGLUserTrackingModeFollowWithHeading; + + // The user location annotation takes its color from the map view tint. + mapView.tintColor = [UIColor redColor]; + + // You can set the attribution button tint separately. + mapView.attributionButton.tintColor = [UIColor lightGrayColor]; + + [self.view addSubview:mapView]; +} + +@end |