aboutsummaryrefslogtreecommitdiffstats
path: root/platform/ios/demo/Examples/ObjectiveC/DefaultStylesExample.m
blob: e6e5771f94bb695695933037fab36554ff3d3bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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