[ios, osx] Renamed Hybrid to Satellite Streets

The style ID has also changed, but the unversioned method will continue to point to the old v8 style ID.
This commit is contained in:
Minh Nguyễn
2016-05-02 14:26:13 -07:00
committed by Minh Nguyễn
parent 4a112c00f1
commit 5ccb43477f
10 changed files with 36 additions and 25 deletions

View File

@@ -18,10 +18,10 @@ extern const DefaultStyle outdoors;
extern const DefaultStyle light;
extern const DefaultStyle dark;
extern const DefaultStyle satellite;
extern const DefaultStyle hybrid;
extern const DefaultStyle satelliteStreets;
const DefaultStyle orderedStyles[] = {
streets, outdoors, light, dark, satellite, hybrid,
streets, outdoors, light, dark, satellite, satelliteStreets,
};
const size_t numOrderedStyles = sizeof(orderedStyles) / sizeof(DefaultStyle);

View File

@@ -99,20 +99,20 @@ static const NSInteger MGLStyleCurrentVersion = 9;
+ (NSURL *)satelliteStyleURLWithVersion:(NSInteger)version;
/**
Returns the URL to version 8 of the Hybrid style.
Returns the URL to version 8 of the Satellite Streets style.
Mapbox Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels.
Mapbox Satellite Streets combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels and translucent roads from Mapbox Streets.
*/
+ (NSURL *)hybridStyleURL __attribute__((deprecated("Use -hybridStyleURLWithVersion:.")));
+ (NSURL *)hybridStyleURL __attribute__((deprecated("Use -satelliteStreetsStyleURLWithVersion:.")));
/**
Returns the URL to the given version of the Hybrid style.
Returns the URL to the given version of the Satellite Streets style.
Mapbox Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels.
Mapbox Satellite Streets combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels and translucent roads from Mapbox Streets.
@param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`.
*/
+ (NSURL *)hybridStyleURLWithVersion:(NSInteger)version;
+ (NSURL *)satelliteStreetsStyleURLWithVersion:(NSInteger)version;
- (instancetype)init NS_UNAVAILABLE;

View File

@@ -27,13 +27,23 @@ MGL_DEFINE_STYLE(outdoors, outdoors)
MGL_DEFINE_STYLE(light, light)
MGL_DEFINE_STYLE(dark, dark)
MGL_DEFINE_STYLE(satellite, satellite)
MGL_DEFINE_STYLE(hybrid, satellite-hybrid)
MGL_DEFINE_STYLE(satelliteStreets, satellite-streets)
// Make sure all the styles listed in mbgl::util::default_styles::orderedStyles
// are defined above and also declared in MGLStyle.h.
static_assert(6 == mbgl::util::default_styles::numOrderedStyles,
"mbgl::util::default_styles::orderedStyles and MGLStyle have different numbers of styles.");
// Hybrid has been renamed Satellite Streets, so the last Hybrid version is hard-coded here.
static NSURL *MGLStyleURL_hybrid;
+ (NSURL *)hybridStyleURL {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
MGLStyleURL_hybrid = [NSURL URLWithString:@"mapbox://styles/mapbox/satellite-hybrid-v8"];
});
return MGLStyleURL_hybrid;
}
// Emerald is no longer getting new versions as a default style, so the current version is hard-coded here.
static NSURL *MGLStyleURL_emerald;
+ (NSURL *)emeraldStyleURL {

View File

@@ -32,7 +32,7 @@
XCTAssertEqualObjects([MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::light.url));
XCTAssertEqualObjects([MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::dark.url));
XCTAssertEqualObjects([MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::satellite.url));
XCTAssertEqualObjects([MGLStyle hybridStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::hybrid.url));
XCTAssertEqualObjects([MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::satelliteStreets.url));
static_assert(6 == mbgl::util::default_styles::numOrderedStyles,
"MGLStyleTests isn’t testing all the styles in mbgl::util::default_styles.");

View File

@@ -9,6 +9,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON
- 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))
- The Hybrid style is now called Satellite Streets. ([#4759](https://github.com/mapbox/mapbox-gl-native/pull/4759))
- The user dot now moves smoothly between user location updates while user location tracking is disabled. ([#1582](https://github.com/mapbox/mapbox-gl-native/pull/1582))
- An MGLAnnotation can be relocated by changing its `coordinate` property in a KVO-compliant way. An MGLMultiPoint cannot be relocated. ([#3835](https://github.com/mapbox/mapbox-gl-native/pull/3835))
- Setting the `image` property of an MGLAnnotationImage to `nil` resets it to the default red pin image and reclaims resources that can be used to customize additional annotations. ([#3835](https://github.com/mapbox/mapbox-gl-native/pull/3835))

View File

@@ -479,7 +479,7 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
@"Light",
@"Dark",
@"Satellite",
@"Hybrid",
@"Satellite Streets",
];
styleURLs = @[
[MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion],
@@ -487,7 +487,7 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
[MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion],
[MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion],
[MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion],
[MGLStyle hybridStyleURLWithVersion:MGLStyleCurrentVersion],
[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion],
];
NSAssert(styleNames.count == styleURLs.count, @"Style names and URLs don’t match.");

View File

@@ -390,7 +390,7 @@
<action selector="setStyle:" target="-1" id="GXt-oK-Hy1"/>
</connections>
</menuItem>
<menuItem title="Hybrid" tag="6" keyEquivalent="6" id="9BL-00-HFt">
<menuItem title="Satellite Streets" tag="6" keyEquivalent="6" id="9BL-00-HFt">
<connections>
<action selector="setStyle:" target="-1" id="oL4-AC-waq"/>
</connections>

View File

@@ -59,9 +59,9 @@
<toolbarItem implicitItemIdentifier="BA3542AF-D63A-4893-9CC7-8F67EF2E82B0" label="Style" paletteLabel="Style" id="u23-0z-Otl" customClass="ValidatedToolbarItem">
<nil key="toolTip"/>
<size key="minSize" width="100" height="26"/>
<size key="maxSize" width="100" height="26"/>
<size key="maxSize" width="120" height="26"/>
<popUpButton key="view" verticalHuggingPriority="750" id="Tzm-Cy-dQg">
<rect key="frame" x="0.0" y="14" width="100" height="26"/>
<rect key="frame" x="0.0" y="14" width="120" height="26"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="roundTextured" title="Streets" bezelStyle="texturedRounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="border" tag="1" imageScaling="proportionallyDown" inset="2" selectedItem="wvt-tP-O3a" id="3PJ-qK-Oh3">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -77,7 +77,7 @@
<menuItem title="Satellite" tag="5" id="CTe-e2-o42">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Hybrid" tag="6" id="7ly-oA-0ND">
<menuItem title="Satellite Streets" tag="6" id="7ly-oA-0ND">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
</items>

View File

@@ -135,7 +135,7 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
styleURL = [MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion];
break;
case 6:
styleURL = [MGLStyle hybridStyleURLWithVersion:MGLStyleCurrentVersion];
styleURL = [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion];
break;
default:
NSAssert(NO, @"Cannot set style from control with tag %li", (long)tag);
@@ -462,7 +462,7 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
state = [styleURL isEqual:[MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion]];
break;
case 6:
state = [styleURL isEqual:[MGLStyle hybridStyleURLWithVersion:MGLStyleCurrentVersion]];
state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion]];
break;
default:
return NO;
@@ -562,7 +562,7 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
[MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion],
[MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion],
[MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion],
[MGLStyle hybridStyleURLWithVersion:MGLStyleCurrentVersion],
[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion],
];
return [styleURLs indexOfObject:self.mapView.styleURL];
}

View File

@@ -4,12 +4,12 @@ namespace mbgl {
namespace util {
namespace default_styles {
const DefaultStyle streets = { "mapbox://styles/mapbox/streets-v9", "Streets" };
const DefaultStyle outdoors = { "mapbox://styles/mapbox/outdoors-v9", "Outdoors" };
const DefaultStyle light = { "mapbox://styles/mapbox/light-v9", "Light" };
const DefaultStyle dark = { "mapbox://styles/mapbox/dark-v9", "Dark" };
const DefaultStyle satellite = { "mapbox://styles/mapbox/satellite-v9", "Satellite" };
const DefaultStyle hybrid = { "mapbox://styles/mapbox/satellite-hybrid-v9", "Hybrid" };
const DefaultStyle streets = { "mapbox://styles/mapbox/streets-v9", "Streets" };
const DefaultStyle outdoors = { "mapbox://styles/mapbox/outdoors-v9", "Outdoors" };
const DefaultStyle light = { "mapbox://styles/mapbox/light-v9", "Light" };
const DefaultStyle dark = { "mapbox://styles/mapbox/dark-v9", "Dark" };
const DefaultStyle satellite = { "mapbox://styles/mapbox/satellite-v9", "Satellite" };
const DefaultStyle satelliteStreets = { "mapbox://styles/mapbox/satellite-streets-v9", "Satellite Streets" };
} // namespace default_styles
} // end namespace util