summaryrefslogtreecommitdiff
path: root/platform/ios/demo/Examples/ObjectiveC/SourceCustomVectorExample.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/demo/Examples/ObjectiveC/SourceCustomVectorExample.m')
-rw-r--r--platform/ios/demo/Examples/ObjectiveC/SourceCustomVectorExample.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/platform/ios/demo/Examples/ObjectiveC/SourceCustomVectorExample.m b/platform/ios/demo/Examples/ObjectiveC/SourceCustomVectorExample.m
new file mode 100644
index 0000000000..069aa4ee26
--- /dev/null
+++ b/platform/ios/demo/Examples/ObjectiveC/SourceCustomVectorExample.m
@@ -0,0 +1,24 @@
+#import "SourceCustomVectorExample.h"
+@import Mapbox;
+
+NSString *const MBXExampleSourceCustomVector = @"SourceCustomVectorExample";
+
+@implementation SourceCustomVectorExample
+
+- (void)viewDidLoad {
+ [super viewDidLoad];
+
+ // Third party vector tile sources can be added.
+
+ // In this case we're using custom style JSON (https://www.mapbox.com/mapbox-gl-style-spec/) to add a third party tile source: <https://vector.mapzen.com/osm/all/{z}/{x}/{y}.mvt>
+ NSURL *customStyleURL = [[NSBundle mainBundle] URLForResource:@"third_party_vector_style" withExtension:@"json"];
+
+ MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:customStyleURL];
+
+ mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
+ mapView.tintColor = [UIColor whiteColor];
+
+ [self.view addSubview:mapView];
+}
+
+@end