summaryrefslogtreecommitdiff
path: root/platform/ios/demo/Examples/ObjectiveC/SatelliteStyleExample.m
blob: dee1b0ab5dfe8f9aa62b1c2bce936c82c82737d6 (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
28
#import "SatelliteStyleExample.h"
@import Mapbox;

NSString *const MBXExampleSatelliteStyle = @"SatelliteStyleExample";

@implementation SatelliteStyleExample

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // A hybrid style with unobtrusive labels is also available via +satelliteStreetsStyleURLWithVersion:.
    NSURL *styleURL = [MGLStyle satelliteStyleURLWithVersion:9];
    MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:styleURL];

    // Tint the ℹ️ button.
    mapView.attributionButton.tintColor = [UIColor whiteColor];

    mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    
    // Set the map’s center coordinate and zoom level.
    [mapView setCenterCoordinate:CLLocationCoordinate2DMake(45.5188, -122.6748)
                       zoomLevel:13
                        animated:NO];
    
    [self.view addSubview:mapView];
}

@end