summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorAnthony Picciano <picciano1@Anthonys-MacBook-Pro.local>2015-03-12 06:22:15 -0600
committerKonstantin Käfer <mail@kkaefer.com>2015-03-12 16:29:45 +0100
commit28e28934c74b0f8668020de03caf61d65a9c9842 (patch)
tree6db17bb96989304a5017d5c07a2e43248894b3f8 /platform
parent74ef8840ce93f8ceb204bbe787f00a460ff51229 (diff)
downloadqtlocation-mapboxgl-28e28934c74b0f8668020de03caf61d65a9c9842.tar.gz
Remove the file extensions from the bundledStyleNames method
Diffstat (limited to 'platform')
-rw-r--r--platform/ios/MGLMapView.mm9
1 files changed, 6 insertions, 3 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm
index 57760717d9..76415432ea 100644
--- a/platform/ios/MGLMapView.mm
+++ b/platform/ios/MGLMapView.mm
@@ -944,15 +944,18 @@ mbgl::DefaultFileSource *mbglFileSource = nullptr;
if (!_bundledStyleNames) {
NSString *stylesPath = [[MGLMapView resourceBundlePath] stringByAppendingString:@"/styles"];
- _bundledStyleNames = [[[NSFileManager defaultManager] contentsOfDirectoryAtPath:stylesPath error:nil] mutableCopy];
+ _bundledStyleNames = [NSMutableArray array];
+ NSArray *bundledStyleNamesWithExtensions = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:stylesPath error:nil];
// Add satellite raster & "hybrid" (satellite raster + vector contours & labels)
NSString *hybridStylePrefix = @"hybrid-";
NSString *satelliteStylePrefix = @"satellite-";
NSMutableArray *hybridStyleNames = [NSMutableArray array];
- for (NSString *styleName in _bundledStyleNames) {
+ for (NSString *styleName in bundledStyleNamesWithExtensions) {
+ [_bundledStyleNames addObject:[styleName stringByDeletingPathExtension]];
+
if ([styleName hasPrefix:satelliteStylePrefix]) {
- [hybridStyleNames addObject:[hybridStylePrefix stringByAppendingString:[styleName substringFromIndex:[satelliteStylePrefix length]]]];
+ [hybridStyleNames addObject:[hybridStylePrefix stringByAppendingString:[[styleName substringFromIndex:[satelliteStylePrefix length]] stringByDeletingPathExtension]]];
}
}
[_bundledStyleNames addObjectsFromArray:hybridStyleNames];