summaryrefslogtreecommitdiff
path: root/platform/ios/demo/Examples/ObjectiveC/CustomStyleExample.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/demo/Examples/ObjectiveC/CustomStyleExample.m')
-rw-r--r--platform/ios/demo/Examples/ObjectiveC/CustomStyleExample.m27
1 files changed, 27 insertions, 0 deletions
diff --git a/platform/ios/demo/Examples/ObjectiveC/CustomStyleExample.m b/platform/ios/demo/Examples/ObjectiveC/CustomStyleExample.m
new file mode 100644
index 0000000000..3793ec5797
--- /dev/null
+++ b/platform/ios/demo/Examples/ObjectiveC/CustomStyleExample.m
@@ -0,0 +1,27 @@
+#import "CustomStyleExample.h"
+@import Mapbox;
+
+NSString *const MBXExampleCustomStyle = @"CustomStyleExample";
+
+@implementation CustomStyleExample
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ // Fill in the next line with your style URL from Mapbox Studio.
+ // <#mapbox://styles/userName/styleHash#>
+ NSURL *styleURL = [NSURL URLWithString:@"mapbox://styles/mapbox/outdoors-v9"];
+ MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds
+ styleURL:styleURL];
+
+ mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+
+ // Set the map’s center coordinate and zoom level.
+ [mapView setCenterCoordinate:CLLocationCoordinate2DMake(45.52954, -122.72317)
+ zoomLevel:14
+ animated:NO];
+
+ [self.view addSubview:mapView];
+}
+
+@end