summaryrefslogtreecommitdiff
path: root/platform/ios/app/MBXViewController.m
diff options
context:
space:
mode:
authorAndrew Kitchen <andrew.kitchen@mapbox.com>2018-01-03 17:16:30 -0800
committerAndrew Kitchen <akitchen@gmail.com>2018-01-19 20:28:57 -0500
commit2c48871c065c6efec42c5660c9560ecdfaa8d359 (patch)
tree4a04691c5de64c101146c68c47a429eaddc24e44 /platform/ios/app/MBXViewController.m
parent40a0b2deb78ac3b03dc4966797edb8e0dc8a415e (diff)
downloadqtlocation-mapboxgl-2c48871c065c6efec42c5660c9560ecdfaa8d359.tar.gz
Adds an integration test harness to the iOS project
This will allow us to write lightweight integration tests between MGLMapView and the core renderer. Also includes a test for the recent custom layer memory fix, reverting the fix in order to demonstrate the failing test.
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