summaryrefslogtreecommitdiff
path: root/platform/ios/app/MBXViewController.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/ios/app/MBXViewController.m')
-rw-r--r--platform/ios/app/MBXViewController.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 4306354030..2fd2b69e83 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -1683,8 +1683,11 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
numStyleURLMethods, (unsigned long)styleNames.count);
});
- self.styleIndex = (self.styleIndex + 1) % styleNames.count;
+ MGLStyle *oldStyle = self.mapView.style;
+ MGLStyleLayer *oldLayer = [oldStyle layerWithIdentifier:@"test-layer"];
+ [oldStyle removeLayer:oldLayer];
+ self.styleIndex = (self.styleIndex + 1) % styleNames.count;
self.mapView.styleURL = styleURLs[self.styleIndex];
UIButton *titleButton = (UIButton *)self.navigationItem.titleView;
@@ -1931,6 +1934,9 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) {
// that a device with an English-language locale is already effectively
// using locale-based country labels.
_usingLocaleBasedCountryLabels = [[self bestLanguageForUser] isEqualToString:@"en"];
+
+ MGLOpenGLStyleLayer *glLayer = [[MGLOpenGLStyleLayer alloc] initWithIdentifier:@"test-layer"];
+ [style addLayer:glLayer];
}
- (void)mapViewRegionIsChanging:(MGLMapView *)mapView