diff options
Diffstat (limited to 'platform/ios/demo/Examples/ObjectiveC/DefaultStylesExample.m')
-rw-r--r-- | platform/ios/demo/Examples/ObjectiveC/DefaultStylesExample.m | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/platform/ios/demo/Examples/ObjectiveC/DefaultStylesExample.m b/platform/ios/demo/Examples/ObjectiveC/DefaultStylesExample.m new file mode 100644 index 0000000000..e6e5771f94 --- /dev/null +++ b/platform/ios/demo/Examples/ObjectiveC/DefaultStylesExample.m @@ -0,0 +1,27 @@ +#import "DefaultStylesExample.h" +@import Mapbox; + +NSString *const MBXExampleDefaultStyles = @"DefaultStylesExample"; + +@implementation DefaultStylesExample + +- (void)viewDidLoad { + [super viewDidLoad]; + + MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds + styleURL:[MGLStyle outdoorsStyleURLWithVersion:9]]; + + // Tint the ℹ️ button and the user location annotation. + mapView.tintColor = [UIColor darkGrayColor]; + + mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + + // Set the map’s center coordinate and zoom level. + [mapView setCenterCoordinate:CLLocationCoordinate2DMake(51.50713, -0.10957) + zoomLevel:13 + animated:NO]; + + [self.view addSubview:mapView]; +} + +@end |