diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-05-08 17:45:22 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-05-12 10:02:27 -0700 |
commit | 886bf2528ff1615a50521e75fc6ea211cef3b8d7 (patch) | |
tree | 6b52b83801a5655ebceb7e26acc7c61260fb05ab /platform/macos/app/MapDocument.m | |
parent | c5ee41a93a1f012acf41f29dc8bd75dc736ff4bc (diff) | |
download | qtlocation-mapboxgl-886bf2528ff1615a50521e75fc6ea211cef3b8d7.tar.gz |
[core, android, ios, macos] Added Traffic Day/Night to default styles
The Styles API section of the Mapbox API Documentation site now lists Traffic Day v2 and Traffic Night v2, so this change adds those styles to all the places where styles are listed.
Also switched iosapp and macosapp to unversioned style factory methods since MGLStyleDefaultVersion is no longer applicable for all styles.
Cherry-picked from 4d6f54553d277c0af24a0b8ff03d2dd7e9284ca2.
Diffstat (limited to 'platform/macos/app/MapDocument.m')
-rw-r--r-- | platform/macos/app/MapDocument.m | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 5be17c1cbe..59c1817f63 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -165,22 +165,28 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio NSURL *styleURL; switch (tag) { case 1: - styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]; + styleURL = [MGLStyle streetsStyleURL]; break; case 2: - styleURL = [MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion]; + styleURL = [MGLStyle outdoorsStyleURL]; break; case 3: - styleURL = [MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion]; + styleURL = [MGLStyle lightStyleURL]; break; case 4: - styleURL = [MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion]; + styleURL = [MGLStyle darkStyleURL]; break; case 5: - styleURL = [MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion]; + styleURL = [MGLStyle satelliteStyleURL]; break; case 6: - styleURL = [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion]; + styleURL = [MGLStyle satelliteStreetsStyleURL]; + break; + case 7: + styleURL = [MGLStyle trafficDayStyleURL]; + break; + case 8: + styleURL = [MGLStyle trafficNightStyleURL]; break; default: NSAssert(NO, @"Cannot set style from control with tag %li", (long)tag); @@ -781,22 +787,25 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio NSCellStateValue state; switch (menuItem.tag) { case 1: - state = [styleURL isEqual:[MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]]; + state = [styleURL isEqual:[MGLStyle streetsStyleURL]]; break; case 2: - state = [styleURL isEqual:[MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion]]; + state = [styleURL isEqual:[MGLStyle outdoorsStyleURL]]; break; case 3: - state = [styleURL isEqual:[MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion]]; + state = [styleURL isEqual:[MGLStyle lightStyleURL]]; break; case 4: - state = [styleURL isEqual:[MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion]]; + state = [styleURL isEqual:[MGLStyle darkStyleURL]]; break; case 5: - state = [styleURL isEqual:[MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion]]; + state = [styleURL isEqual:[MGLStyle satelliteStyleURL]]; break; case 6: - state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion]]; + state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURL]]; + break; + case 7: + state = [styleURL isEqual:[MGLStyle trafficDayStyleURL]]; break; default: return NO; @@ -954,12 +963,14 @@ NS_ARRAY_OF(id <MGLAnnotation>) *MBXFlattenedShapes(NS_ARRAY_OF(id <MGLAnnotatio } NSArray *styleURLs = @[ - [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion], - [MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion], - [MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion], - [MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion], - [MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion], - [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion], + [MGLStyle streetsStyleURL], + [MGLStyle outdoorsStyleURL], + [MGLStyle lightStyleURL], + [MGLStyle darkStyleURL], + [MGLStyle satelliteStyleURL], + [MGLStyle satelliteStreetsStyleURL], + [MGLStyle trafficDayStyleURL], + [MGLStyle trafficNightStyleURL], ]; return [styleURLs indexOfObject:self.mapView.styleURL]; } |