diff options
author | Fabian Guerra Soto <fabian.guerra@mapbox.com> | 2017-09-15 17:00:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-15 17:00:54 -0400 |
commit | b2e33a452d2ccc36c5c281d2090182f1395fc1b4 (patch) | |
tree | 35b780cc47740833de1ff5590a62b5ac7746aeea /platform/darwin/src/MGLStyle.mm | |
parent | a6224abc33f599f0352682c411b3831b896fb97c (diff) | |
download | qtlocation-mapboxgl-b2e33a452d2ccc36c5c281d2090182f1395fc1b4.tar.gz |
[ios, macos] Deprecate trafficDayStyleURL and trafficNightStyleURL (#9918)
* [ios, macos] Deprecate trafficDayStyleURL and trafficNightStyleURL
* [ios, macos] Update changelogs.
* [ios, macos] Update trafficDayStyleURL and trafficNightStyleURL tests in MGLStyleTests.
Diffstat (limited to 'platform/darwin/src/MGLStyle.mm')
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index d8aa014341..23e75f211c 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -106,8 +106,6 @@ MGL_DEFINE_STYLE(light, light) MGL_DEFINE_STYLE(dark, dark) MGL_DEFINE_STYLE(satellite, satellite) MGL_DEFINE_STYLE(satelliteStreets, satellite-streets) -MGL_DEFINE_STYLE(trafficDay, traffic-day) -MGL_DEFINE_STYLE(trafficNight, traffic-night) // Make sure all the styles listed in mbgl::util::default_styles::orderedStyles // are defined above and also declared in MGLStyle.h. @@ -134,6 +132,35 @@ static NSURL *MGLStyleURL_emerald; return MGLStyleURL_emerald; } +// Traffic Day is no longer getting new versions as a default style, so the current version is hard-coded here. +static NSURL *MGLStyleURL_trafficDay; ++ (NSURL *)trafficDayStyleURL { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + MGLStyleURL_trafficDay = [NSURL URLWithString:@"mapbox://styles/mapbox/traffic-day-v2"]; + }); + return MGLStyleURL_trafficDay; +} + ++ (NSURL *)trafficDayStyleURLWithVersion:(NSInteger)version { + return [NSURL URLWithString:[@"mapbox://styles/mapbox/traffic-day-v" stringByAppendingFormat:@"%li", (long)version]]; +} + +// Traffic Night is no longer getting new versions as a default style, so the current version is hard-coded here. +static NSURL *MGLStyleURL_trafficNight; ++ (NSURL *)trafficNightStyleURL { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + MGLStyleURL_trafficNight = [NSURL URLWithString:@"mapbox://styles/mapbox/traffic-night-v2"]; + }); + return MGLStyleURL_trafficNight; +} + ++ (NSURL *)trafficNightStyleURLWithVersion:(NSInteger)version { + return [NSURL URLWithString:[@"mapbox://styles/mapbox/traffic-night-v" stringByAppendingFormat:@"%li", (long)version]]; +} + + #pragma mark - - (instancetype)initWithMapView:(MGLMapView *)mapView { |