From 3749f0eb4da4e070bad6504e3324ff044075826c Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Tue, 24 Oct 2017 11:44:37 -0400 Subject: Code to reproduce the issue --- platform/ios/app/MBXViewController.m | 15 +++++++++++++++ platform/ios/app/Main.storyboard | 32 +++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 2c3d26b48..daaf7a069 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -1909,5 +1909,20 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self.hudLabel setTitle:hudString forState:UIControlStateNormal]; } +- (IBAction)addStyle:(id)sender { + MGLRasterSource *source = [[MGLRasterSource alloc] initWithIdentifier:@"stamen-watercolor" tileURLTemplates:@[@"https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg"] options:@{MGLTileSourceOptionTileSize:@256}]; + + MGLRasterStyleLayer *rasterLayer = [[MGLRasterStyleLayer alloc] initWithIdentifier:@"custom-stamen-watercolor" source:source]; + + rasterLayer.rasterOpacity = [MGLStyleValue valueWithRawValue:@0.4]; + rasterLayer.visible = YES; + + [self.mapView.style addSource:source]; + + MGLStyleLayer *water = [self.mapView.style layerWithIdentifier:@"water"]; + if (water) { + [self.mapView.style insertLayer:rasterLayer belowLayer:water]; + } +} @end diff --git a/platform/ios/app/Main.storyboard b/platform/ios/app/Main.storyboard index 507582213..ea72ef3a9 100644 --- a/platform/ios/app/Main.storyboard +++ b/platform/ios/app/Main.storyboard @@ -1,11 +1,11 @@ - + - + @@ -26,6 +26,20 @@ + + + @@ -34,7 +48,7 @@