[ios, osx] Pin unversioned style URL APIs to v8 styles
Cherry-picked from 4a112c00f1.
This commit is contained in:
committed by
Minh Nguyễn
parent
1d37eb3903
commit
f7f6f775f4
@@ -19,7 +19,7 @@ static const NSInteger MGLStyleCurrentVersion = 9;
|
||||
@interface MGLStyle : NSObject
|
||||
|
||||
/**
|
||||
Returns the URL to the current version of the Streets style.
|
||||
Returns the URL to version 8 of the Streets style.
|
||||
|
||||
Mapbox Streets is a complete base map that balances nature, commerce, and infrastructure.
|
||||
*/
|
||||
@@ -35,7 +35,7 @@ static const NSInteger MGLStyleCurrentVersion = 9;
|
||||
+ (NSURL *)streetsStyleURLWithVersion:(NSInteger)version;
|
||||
|
||||
/**
|
||||
Returns the URL to the current version of the Emerald style.
|
||||
Returns the URL to version 8 of the Emerald style.
|
||||
|
||||
Mapbox Emerald is a versatile style with emphasis on road networks and public transportation.
|
||||
*/
|
||||
@@ -51,7 +51,7 @@ static const NSInteger MGLStyleCurrentVersion = 9;
|
||||
+ (NSURL *)outdoorsStyleURLWithVersion:(NSInteger)version;
|
||||
|
||||
/**
|
||||
Returns the URL to the current version of the Light style.
|
||||
Returns the URL to version 8 of the Light style.
|
||||
|
||||
Mapbox Light is a subtle, light-colored backdrop for data visualizations.
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ static const NSInteger MGLStyleCurrentVersion = 9;
|
||||
+ (NSURL *)lightStyleURLWithVersion:(NSInteger)version;
|
||||
|
||||
/**
|
||||
Returns the URL to the current version of the Dark style.
|
||||
Returns the URL to version 8 of the Dark style.
|
||||
|
||||
Mapbox Dark is a subtle, dark-colored backdrop for data visualizations.
|
||||
*/
|
||||
@@ -83,7 +83,7 @@ static const NSInteger MGLStyleCurrentVersion = 9;
|
||||
+ (NSURL *)darkStyleURLWithVersion:(NSInteger)version;
|
||||
|
||||
/**
|
||||
Returns the URL to the current version of the Satellite style.
|
||||
Returns the URL to version 8 of the Satellite style.
|
||||
|
||||
Mapbox Satellite is a beautiful global satellite and aerial imagery layer.
|
||||
*/
|
||||
@@ -99,7 +99,7 @@ static const NSInteger MGLStyleCurrentVersion = 9;
|
||||
+ (NSURL *)satelliteStyleURLWithVersion:(NSInteger)version;
|
||||
|
||||
/**
|
||||
Returns the URL to the current version of the Hybrid style.
|
||||
Returns the URL to version 8 of the Hybrid style.
|
||||
|
||||
Mapbox Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels.
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ static_assert(mbgl::util::default_styles::currentVersion == MGLStyleCurrentVersi
|
||||
+ (NSURL *)name##StyleURL { \
|
||||
static dispatch_once_t onceToken; \
|
||||
dispatch_once(&onceToken, ^{ \
|
||||
MGLStyleURL_##name = [self name##StyleURLWithVersion:MGLStyleCurrentVersion]; \
|
||||
MGLStyleURL_##name = [self name##StyleURLWithVersion:8]; \
|
||||
}); \
|
||||
return MGLStyleURL_##name; \
|
||||
} \
|
||||
|
||||
@@ -4,7 +4,7 @@ Mapbox welcomes participation and contributions from everyone. If you’d like
|
||||
|
||||
## 3.2.2
|
||||
|
||||
- Existing MGLStyle class methods that return default style URLs have been deprecated in favor of new methods that require an explicit style version parameter. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759))
|
||||
- Existing MGLStyle class methods that return default style URLs have been deprecated in favor of new methods that require an explicit style version parameter. The deprecated, unversioned methods continue to return version 8 of the respective styles and will not be updated as new versions of the styles are released. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759))
|
||||
- Deprecated `+[MGLStyle emeraldStyleURL]` with no replacement method. To use the Emerald style going forward, we recommend that you use the underlying URL. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759))
|
||||
- Added `+[MGLStyle outdoorsStyleURLWithVersion:]` for the new Outdoors style. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759))
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
- (void)testUnversionedStyleURLs {
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
XCTAssertEqualObjects([MGLStyle streetsStyleURL].absoluteString, @(mbgl::util::default_styles::streets.url));
|
||||
XCTAssertEqualObjects([MGLStyle streetsStyleURL].absoluteString, @"mapbox://styles/mapbox/streets-v8");
|
||||
XCTAssertEqualObjects([MGLStyle emeraldStyleURL].absoluteString, @"mapbox://styles/mapbox/emerald-v8");
|
||||
XCTAssertEqualObjects([MGLStyle lightStyleURL].absoluteString, @(mbgl::util::default_styles::light.url));
|
||||
XCTAssertEqualObjects([MGLStyle darkStyleURL].absoluteString, @(mbgl::util::default_styles::dark.url));
|
||||
XCTAssertEqualObjects([MGLStyle satelliteStyleURL].absoluteString, @(mbgl::util::default_styles::satellite.url));
|
||||
XCTAssertEqualObjects([MGLStyle hybridStyleURL].absoluteString, @(mbgl::util::default_styles::hybrid.url));
|
||||
XCTAssertEqualObjects([MGLStyle lightStyleURL].absoluteString, @"mapbox://styles/mapbox/light-v8");
|
||||
XCTAssertEqualObjects([MGLStyle darkStyleURL].absoluteString, @"mapbox://styles/mapbox/dark-v8");
|
||||
XCTAssertEqualObjects([MGLStyle satelliteStyleURL].absoluteString, @"mapbox://styles/mapbox/satellite-v8");
|
||||
XCTAssertEqualObjects([MGLStyle hybridStyleURL].absoluteString, @"mapbox://styles/mapbox/satellite-hybrid-v8");
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user