diff options
Diffstat (limited to 'platform/ios/demo/Examples/ObjectiveC/CustomRasterStyleExample.m')
-rw-r--r-- | platform/ios/demo/Examples/ObjectiveC/CustomRasterStyleExample.m | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/platform/ios/demo/Examples/ObjectiveC/CustomRasterStyleExample.m b/platform/ios/demo/Examples/ObjectiveC/CustomRasterStyleExample.m new file mode 100644 index 000000000..5b5be9d3c --- /dev/null +++ b/platform/ios/demo/Examples/ObjectiveC/CustomRasterStyleExample.m @@ -0,0 +1,20 @@ +#import "CustomRasterStyleExample.h" +@import Mapbox; + +NSString *const MBXExampleCustomRasterStyle = @"CustomRasterStyleExample"; + +@implementation CustomRasterStyleExample + +- (void)viewDidLoad { + [super viewDidLoad]; + + NSURL *styleURL = [NSURL URLWithString:@"https://www.mapbox.com/ios-sdk/files/mapbox-raster-v8.json"]; + // Local paths are also acceptable. + + MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:styleURL]; + mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + + [self.view addSubview:mapView]; +} + +@end |