From 023be536d5f61f1404a85fe394b1e9435cb456e9 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 11 Apr 2016 16:14:47 -0400 Subject: [PATCH 01/13] [ios] Restart user location heading updates on validation Fixes #4668. Thanks to @JThramer for reporting. Cherry-picked from eda132d922df160a413bac9238e98d96c8748667. --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index d038fafe2..7ef2fc616 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -5,6 +5,7 @@ Mapbox welcomes participation and contributions from everyone. If you’d like ## 3.2.1 - Fixed a hang that could occur if the host application attempts to set user defaults on a background queue. ([#4745](https://github.com/mapbox/mapbox-gl-native/pull/4745)) +- User location heading updates now resume properly when an app becomes active again. ([#4674](https://github.com/mapbox/mapbox-gl-native/pull/4674)) ## 3.2.0 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index b7fc9b9a3..17323720a 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3046,6 +3046,11 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) self.locationManager.headingFilter = 5.0; self.locationManager.delegate = self; [self.locationManager startUpdatingLocation]; + + if (self.userTrackingMode == MGLUserTrackingModeFollowWithHeading) + { + [self.locationManager startUpdatingHeading]; + } } else if ( ! shouldEnableLocationServices && self.locationManager) { From d07e5b5f51b190cc7798c46249e99485172ecc22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Wed, 20 Apr 2016 00:46:14 -0700 Subject: [PATCH 02/13] [ios, osx] Use HTML links in documentation Replaced Markdown syntax with HTML syntax for hyperlinks in documentation comments. HTML links work both inside Xcode (whether Objective-C or Swift) and on the Web (via jazzy). Fixes #3961. Cherry-picked from de0705c7ede7fea5980ed220a1160085630bd89e. --- platform/darwin/include/MGLAccountManager.h | 15 +++++---- platform/darwin/include/MGLOfflineStorage.h | 6 ++-- platform/ios/CHANGELOG.md | 1 + platform/ios/include/MGLMapView.h | 33 +++++++++--------- platform/ios/src/MGLCompactCalloutView.h | 2 +- platform/osx/include/MGLMapView.h | 37 +++++++++++---------- 6 files changed, 49 insertions(+), 45 deletions(-) diff --git a/platform/darwin/include/MGLAccountManager.h b/platform/darwin/include/MGLAccountManager.h index 5cf729ef3..63440046f 100644 --- a/platform/darwin/include/MGLAccountManager.h +++ b/platform/darwin/include/MGLAccountManager.h @@ -13,15 +13,16 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark Authorizing Access /** - Set the [Mapbox access token](https://www.mapbox.com/help/define-access-token/) + Set the + Mapbox access token to be used by all instances of MGLMapView in the current application. Mapbox-hosted vector tiles and styles require an API access token, which you can obtain from the - [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). Access - tokens associate requests to Mapbox’s vector tile and style APIs with your - Mapbox account. They also deter other developers from using your styles without - your permission. + Mapbox account page. + Access tokens associate requests to Mapbox’s vector tile and style APIs with + your Mapbox account. They also deter other developers from using your styles + without your permission. @param accessToken A Mapbox access token. Calling this method with a value of `nil` has no effect. @@ -37,8 +38,8 @@ NS_ASSUME_NONNULL_BEGIN /** Returns the - [Mapbox access token](https://www.mapbox.com/help/define-access-token/) in use - by instances of MGLMapView in the current application. + Mapbox access token + in use by instances of MGLMapView in the current application. */ + (nullable NSString *)accessToken; diff --git a/platform/darwin/include/MGLOfflineStorage.h b/platform/darwin/include/MGLOfflineStorage.h index 5544663d3..20cc521f2 100644 --- a/platform/darwin/include/MGLOfflineStorage.h +++ b/platform/darwin/include/MGLOfflineStorage.h @@ -211,9 +211,9 @@ typedef void (^MGLOfflinePackRemovalCompletionHandler)(NSError * _Nullable error attempt to download additional tiles until already downloaded tiles are removed by calling the `-removePack:withCompletionHandler:` method. - @note The [Mapbox Terms of Service](https://www.mapbox.com/tos/) prohibits - changing or bypassing this limit without permission from Mapbox. Contact - your Mapbox sales representative to have the limit raised. + @note The Mapbox Terms of Service + prohibits changing or bypassing this limit without permission from Mapbox. + Contact your Mapbox sales representative to have the limit raised. */ - (void)setMaximumAllowedMapboxTiles:(uint64_t)maximumCount; diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 7ef2fc616..b560535be 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -6,6 +6,7 @@ Mapbox welcomes participation and contributions from everyone. If you’d like - Fixed a hang that could occur if the host application attempts to set user defaults on a background queue. ([#4745](https://github.com/mapbox/mapbox-gl-native/pull/4745)) - User location heading updates now resume properly when an app becomes active again. ([#4674](https://github.com/mapbox/mapbox-gl-native/pull/4674)) +- Fixed an issue causing hyperlinks in the documentation to be displayed as raw Markdown syntax when viewed in Xcode’s Quick Help popover or sidebar. ([#4760](https://github.com/mapbox/mapbox-gl-native/pull/4760)) ## 3.2.0 diff --git a/platform/ios/include/MGLMapView.h b/platform/ios/include/MGLMapView.h index 1a17507ae..bfc1d3c67 100644 --- a/platform/ios/include/MGLMapView.h +++ b/platform/ios/include/MGLMapView.h @@ -52,23 +52,24 @@ typedef NS_OPTIONS(NSUInteger, MGLMapDebugMaskOptions) { viewpoints, and present information in the form of annotations and overlays. The map view loads scalable vector tiles that conform to the - [Mapbox Vector Tile Specification](https://github.com/mapbox/vector-tile-spec). + Mapbox Vector Tile Specification. It styles them with a style that conforms to the - [Mapbox GL style specification](https://www.mapbox.com/mapbox-gl-style-spec/). - Such styles can be designed in [Mapbox Studio](https://www.mapbox.com/studio/) - and hosted on mapbox.com. + Mapbox GL style specification. + Such styles can be designed in + Mapbox Studio and hosted on + mapbox.com. A collection of Mapbox-hosted styles is available through the `MGLStyle` class. These basic styles use - [Mapbox Streets](https://www.mapbox.com/developers/vector-tiles/mapbox-streets) - or [Mapbox Satellite](https://www.mapbox.com/satellite/) data sources, but - you can specify a custom style that makes use of your own data. + Mapbox Streets + or Mapbox Satellite data + sources, but you can specify a custom style that makes use of your own data. Mapbox-hosted vector tiles and styles require an API access token, which you can obtain from the - [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). Access - tokens associate requests to Mapbox's vector tile and style APIs with your - Mapbox account. They also deter other developers from using your styles + Mapbox account page. + Access tokens associate requests to Mapbox's vector tile and style APIs with + your Mapbox account. They also deter other developers from using your styles without your permission. @note You are responsible for getting permission to use the map data and for @@ -146,7 +147,7 @@ IB_DESIGNABLE @note The Mapbox terms of service, which governs the use of Mapbox-hosted vector tiles and styles, - [requires](https://www.mapbox.com/help/mapbox-logo/) most Mapbox + requires most Mapbox customers to display the Mapbox logo. If this applies to you, do not hide this view or change its contents. */ @@ -158,18 +159,18 @@ IB_DESIGNABLE @note The Mapbox terms of service, which governs the use of Mapbox-hosted vector tiles and styles, - [requires](https://www.mapbox.com/help/attribution/) these copyright - notices to accompany any map that features Mapbox-designed styles, + requires these + copyright notices to accompany any map that features Mapbox-designed styles, OpenStreetMap data, or other Mapbox data such as satellite or terrain data. If that applies to this map view, do not hide this view or remove any notices from it. @note You are additionally - [required](https://www.mapbox.com/help/telemetry-opt-out-for-users/) to - provide users with the option to disable anonymous usage and location + required + to provide users with the option to disable anonymous usage and location sharing (telemetry). If this view is hidden, you must implement this setting elsewhere in your app or via `Settings.bundle`. See our - [website](https://www.mapbox.com/ios-sdk/#telemetry_opt_out) for + website for implementation help. */ @property (nonatomic, readonly) UIButton *attributionButton; diff --git a/platform/ios/src/MGLCompactCalloutView.h b/platform/ios/src/MGLCompactCalloutView.h index 5f8edd921..ebe27c842 100644 --- a/platform/ios/src/MGLCompactCalloutView.h +++ b/platform/ios/src/MGLCompactCalloutView.h @@ -2,7 +2,7 @@ #import "MGLCalloutView.h" /** - A concrete implementation of `MGLCalloutView` based on [SMCalloutView](https://github.com/nfarina/calloutview). This callout view displays the represented annotation’s title, subtitle, and accessory views in a compact, two-line layout. + A concrete implementation of `MGLCalloutView` based on SMCalloutView. This callout view displays the represented annotation’s title, subtitle, and accessory views in a compact, two-line layout. */ @interface MGLCompactCalloutView : SMCalloutView diff --git a/platform/osx/include/MGLMapView.h b/platform/osx/include/MGLMapView.h index ca55ba7cd..f6ba86fb0 100644 --- a/platform/osx/include/MGLMapView.h +++ b/platform/osx/include/MGLMapView.h @@ -37,23 +37,24 @@ typedef NS_OPTIONS(NSUInteger, MGLMapDebugMaskOptions) { viewpoints, and present information in the form of annotations and overlays. The map view loads scalable vector tiles that conform to the - [Mapbox Vector Tile Specification](https://github.com/mapbox/vector-tile-spec). + Mapbox Vector Tile Specification. It styles them with a style that conforms to the - [Mapbox GL style specification](https://www.mapbox.com/mapbox-gl-style-spec/). - Such styles can be designed in [Mapbox Studio](https://www.mapbox.com/studio/) - and hosted on mapbox.com. + Mapbox GL style specification. + Such styles can be designed in + Mapbox Studio and hosted on + mapbox.com. A collection of Mapbox-hosted styles is available through the MGLStyle class. These basic styles use - [Mapbox Streets](https://www.mapbox.com/developers/vector-tiles/mapbox-streets) - or [Mapbox Satellite](https://www.mapbox.com/satellite/) data sources, but - you can specify a custom style that makes use of your own data. + Mapbox Streets + or Mapbox Satellite data + sources, but you can specify a custom style that makes use of your own data. Mapbox-hosted vector tiles and styles require an API access token, which you can obtain from the - [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). Access - tokens associate requests to Mapbox’s vector tile and style APIs with your - Mapbox account. They also deter other developers from using your styles + Mapbox account page. + Access tokens associate requests to Mapbox’s vector tile and style APIs with + your Mapbox account. They also deter other developers from using your styles without your permission. @note You are responsible for getting permission to use the map data and for @@ -128,9 +129,9 @@ IB_DESIGNABLE @note The Mapbox terms of service, which governs the use of Mapbox-hosted vector tiles and styles, - [requires](https://www.mapbox.com/help/mapbox-logo/) most Mapbox - customers to display the Mapbox logo. If this applies to you, do not - hide this view or change its contents. */ + requires most + Mapbox customers to display the Mapbox logo. If this applies to you, do + not hide this view or change its contents. */ @property (nonatomic, readonly) NSImageView *logoView; /** A view showing legally required copyright notices, positioned along the @@ -138,11 +139,11 @@ IB_DESIGNABLE @note The Mapbox terms of service, which governs the use of Mapbox-hosted vector tiles and styles, - [requires](https://www.mapbox.com/help/attribution/) these copyright - notices to accompany any map that features Mapbox-designed styles, - OpenStreetMap data, or other Mapbox data such as satellite or terrain - data. If that applies to this map view, do not hide this view or remove - any notices from it. */ + requires these + copyright notices to accompany any map that features Mapbox-designed + styles, OpenStreetMap data, or other Mapbox data such as satellite or + terrain data. If that applies to this map view, do not hide this view or + remove any notices from it. */ @property (nonatomic, readonly) NSView *attributionView; #pragma mark Manipulating the viewpoint From f4d8a7d5d522156220f94fbfb1e64d4be31cfb0d Mon Sep 17 00:00:00 2001 From: Jesse Bounds Date: Wed, 6 Apr 2016 13:10:41 -0400 Subject: [PATCH 03/13] [ios] Add script to automate s3 build and publish process A large part of the iOS SDK deploy process is creating the various binary flavors, uploading them to s3, and then testing that those uploads worked by downloading them from s3 before uploading and attaching them to the github release. This script automates that build, upload, download, upload and attach process and can be run after `mbx auth`. Cherry-picked from 89db01fef0abe258e152eeb2013358c74f8bfeec. --- platform/ios/scripts/deploy-packages.sh | 84 +++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 platform/ios/scripts/deploy-packages.sh diff --git a/platform/ios/scripts/deploy-packages.sh b/platform/ios/scripts/deploy-packages.sh new file mode 100755 index 000000000..64cb472f6 --- /dev/null +++ b/platform/ios/scripts/deploy-packages.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u + +usage() { +cat < Date: Wed, 6 Apr 2016 18:30:28 -0400 Subject: [PATCH 04/13] Updated jazzy config flags for jazzy 0.6.0 Fixes #4620. Cherry-picked from cee1b0b526dbec0dea9c4daaac94f333395062e2. --- .jazzy.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index 602e8cdb0..216fd82ae 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -1,14 +1,14 @@ -module_name: Mapbox -author_name: Mapbox +module: Mapbox +author: Mapbox author_url: https://www.mapbox.com/ github_url: https://github.com/mapbox/mapbox-gl-native dash_url: https://www.mapbox.com/ios-sdk/docsets/Mapbox.xml copyright: '© 2014–2016 [Mapbox](https://www.mapbox.com/). See [license](https://github.com/mapbox/mapbox-gl-native/blob/master/LICENSE.md) for more details.' -custom_head: | +head: | -objc_mode: Yes +objc: Yes skip_undocumented: Yes hide_documentation_coverage: Yes umbrella_header: platform/ios/include/Mapbox.h From 6fd80aebde12a4ed34f75a751f702522853923d0 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Wed, 20 Apr 2016 19:09:08 -0400 Subject: [PATCH 05/13] ios-v3.2.1 Update podspec files for version 3.2.1 --- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index ae71f801a..86f19bf30 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.2.0-symbols' + m.version = '3.2.1-symbols' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.' diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 68429fb1f..79ab6552b 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.2.0' + m.version = '3.2.1' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.' From 1d37eb39034f504187fe5cfd822aa69e463bf585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Tue, 19 Apr 2016 21:15:30 -0700 Subject: [PATCH 06/13] [core, ios, osx] Version default style URL APIs; deprecated Emerald MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated default styles from v8 to v9. Deprecated the MGLMapView class methods in favor of new methods that take a version parameter. Deprecated Emerald outright in favor of Outdoors. Replaced usage of the unversioned MGLStyle methods with the corresponding versioned methods and MGLStyleCurrentVersion to ensure consistency. Expanded MGLStyle unit tests to also assert that MGLStyle has the right number of style URL methods and that they’re all public. Linked the OS X SDK unit test bundle to libmbgl-core.a. Removed an unnecessary dependency on osxapp. Replaced Emerald with Outdoors in iosapp and osxapp. Fixes the iOS and OS X side of #4577 and #4702. Cherry-picked from 2a4eeadb295775236fe1a89b50f9179b790b127a. --- .jazzy.yaml | 1 + include/mbgl/util/default_styles.hpp | 6 +- platform/darwin/include/MGLStyle.h | 101 ++++++++++++++---- platform/darwin/src/MGLStyle.mm | 35 ++++-- .../darwin/src/MGLTilePyramidOfflineRegion.mm | 2 +- platform/ios/CHANGELOG.md | 6 ++ platform/ios/src/MGLMapView.mm | 2 +- platform/osx/app/MainMenu.xib | 2 +- platform/osx/app/MapDocument.m | 36 +++---- platform/osx/app/MapDocument.xib | 6 +- platform/osx/src/MGLMapView.mm | 4 +- platform/osx/test/MGLOfflineRegionTests.m | 4 +- platform/osx/test/MGLOfflineStorageTests.m | 2 +- platform/osx/test/MGLStyleTests.mm | 63 ++++++++++- src/mbgl/util/default_styles.cpp | 12 +-- 15 files changed, 214 insertions(+), 68 deletions(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index 216fd82ae..116ee52c7 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -22,6 +22,7 @@ custom_categories: - MGLMapView - MGLMapViewDelegate - MGLStyle + - MGLStyleCurrentVersion - MGLUserTrackingMode - name: Annotations children: diff --git a/include/mbgl/util/default_styles.hpp b/include/mbgl/util/default_styles.hpp index 3f5b6bd31..2043dd3f5 100644 --- a/include/mbgl/util/default_styles.hpp +++ b/include/mbgl/util/default_styles.hpp @@ -14,17 +14,19 @@ struct DefaultStyle { }; extern const DefaultStyle streets; -extern const DefaultStyle emerald; +extern const DefaultStyle outdoors; extern const DefaultStyle light; extern const DefaultStyle dark; extern const DefaultStyle satellite; extern const DefaultStyle hybrid; const DefaultStyle orderedStyles[] = { - streets, emerald, light, dark, satellite, hybrid, + streets, outdoors, light, dark, satellite, hybrid, }; const size_t numOrderedStyles = sizeof(orderedStyles) / sizeof(DefaultStyle); +static const unsigned currentVersion = 9; + } // end namespace default_styles } // end namespace util } // end namespace mbgl diff --git a/platform/darwin/include/MGLStyle.h b/platform/darwin/include/MGLStyle.h index e5b2de877..2a2d61657 100644 --- a/platform/darwin/include/MGLStyle.h +++ b/platform/darwin/include/MGLStyle.h @@ -4,50 +4,115 @@ NS_ASSUME_NONNULL_BEGIN -/** A collection of convenience methods for creating style URLs of default styles provided by Mapbox. These instances of NSURL are cached. */ +/** + A version number identifying the latest released version of the suite of default styles provided by Mapbox. This version number may be passed into one of the “StyleURLWithVersion” class methods of MGLStyle. + + The value of this constant is current as of the date on which this SDK was published. Consult the Mapbox Styles API documentation for the most up-to-date style versioning information. + + @warning The value of this constant may change in a future release of the SDK. If you use any feature that depends on a specific implementation detail in a default style, you may use the current value of this constant or the underlying style URL, but do not use the constant itself. Such implementation details may change significantly from version to version. + */ +static const NSInteger MGLStyleCurrentVersion = 9; + +/** + A collection of convenience methods for creating style URLs of default styles provided by Mapbox. + */ @interface MGLStyle : NSObject /** - Returns the Streets style URL. + Returns the URL to the current version of the Streets style. - Mapbox Streets is a complete base map, perfect for incorporating your own data. + Mapbox Streets is a complete base map that balances nature, commerce, and infrastructure. */ -+ (NSURL *)streetsStyleURL; ++ (NSURL *)streetsStyleURL __attribute__((deprecated("Use -streetsStyleURLWithVersion:."))); /** - Returns the Emerald style URL. + Returns the URL to the given version of the Streets style. - Emerald is a versatile style with emphasis on road networks and public transportation. + Mapbox Streets is a complete base map that balances nature, commerce, and infrastructure. + + @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. */ -+ (NSURL *)emeraldStyleURL; ++ (NSURL *)streetsStyleURLWithVersion:(NSInteger)version; /** - Returns the Light style URL. + Returns the URL to the current version of the Emerald style. - Light is a subtle, light-colored backdrop for data visualizations. + Mapbox Emerald is a versatile style with emphasis on road networks and public transportation. */ -+ (NSURL *)lightStyleURL; ++ (NSURL *)emeraldStyleURL __attribute__((deprecated("Use ."))); /** - Returns the Dark style URL. + Returns the URL to the given version of the Outdoors style. - Dark is a subtle, dark-colored backdrop for data visualizations. + Mapbox Outdoors is a rugged style that emphasizes physical terrain and outdoor activities. + + @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. */ -+ (NSURL *)darkStyleURL; ++ (NSURL *)outdoorsStyleURLWithVersion:(NSInteger)version; /** - Returns the Satellite style URL. + Returns the URL to the current version of the Light style. + + Mapbox Light is a subtle, light-colored backdrop for data visualizations. + */ ++ (NSURL *)lightStyleURL __attribute__((deprecated("Use -lightStyleURLWithVersion:."))); + +/** + Returns the URL to the given version of the Light style. + + Mapbox Light is a subtle, light-colored backdrop for data visualizations. + + @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. + */ ++ (NSURL *)lightStyleURLWithVersion:(NSInteger)version; + +/** + Returns the URL to the current version of the Dark style. + + Mapbox Dark is a subtle, dark-colored backdrop for data visualizations. + */ ++ (NSURL *)darkStyleURL __attribute__((deprecated("Use -darkStyleURLWithVersion:."))); + +/** + Returns the URL to the given version of the Dark style. + + Mapbox Dark is a subtle, dark-colored backdrop for data visualizations. + + @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. + */ ++ (NSURL *)darkStyleURLWithVersion:(NSInteger)version; + +/** + Returns the URL to the current version of the Satellite style. Mapbox Satellite is a beautiful global satellite and aerial imagery layer. */ -+ (NSURL *)satelliteStyleURL; ++ (NSURL *)satelliteStyleURL __attribute__((deprecated("Use -satelliteStyleURLWithVersion:."))); /** - Returns the Hybrid style URL. + Returns the URL to the given version of the Satellite style. - Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels. + Mapbox Satellite is a beautiful global satellite and aerial imagery layer. + + @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. */ -+ (NSURL *)hybridStyleURL; ++ (NSURL *)satelliteStyleURLWithVersion:(NSInteger)version; + +/** + Returns the URL to the current version of the Hybrid style. + + Mapbox Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels. + */ ++ (NSURL *)hybridStyleURL __attribute__((deprecated("Use -hybridStyleURLWithVersion:."))); + +/** + Returns the URL to the given version of the Hybrid style. + + Mapbox Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels. + + @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. + */ ++ (NSURL *)hybridStyleURLWithVersion:(NSInteger)version; - (instancetype)init NS_UNAVAILABLE; diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index 15a25db9e..c906337a5 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -4,27 +4,44 @@ @implementation MGLStyle -// name is lowercase -#define MGL_DEFINE_STYLE(name) \ +static_assert(mbgl::util::default_styles::currentVersion == MGLStyleCurrentVersion, "mbgl::util::default_styles::currentVersion and MGLStyleCurrentVersion disagree."); + +/// @param name The style’s marketing name, written in lower camelCase. +/// @param fileName The last path component in the style’s URL, excluding the version suffix. +#define MGL_DEFINE_STYLE(name, fileName) \ static NSURL *MGLStyleURL_##name; \ + (NSURL *)name##StyleURL { \ static dispatch_once_t onceToken; \ dispatch_once(&onceToken, ^{ \ - MGLStyleURL_##name = [NSURL URLWithString:@(mbgl::util::default_styles::name.url)]; \ + MGLStyleURL_##name = [self name##StyleURLWithVersion:MGLStyleCurrentVersion]; \ }); \ return MGLStyleURL_##name; \ + } \ + \ + + (NSURL *)name##StyleURL##WithVersion:(NSInteger)version { \ + return [NSURL URLWithString:[@"mapbox://styles/mapbox/" #fileName "-v" stringByAppendingFormat:@"%li", (long)version]]; \ } -MGL_DEFINE_STYLE(streets) -MGL_DEFINE_STYLE(emerald) -MGL_DEFINE_STYLE(light) -MGL_DEFINE_STYLE(dark) -MGL_DEFINE_STYLE(satellite) -MGL_DEFINE_STYLE(hybrid) +MGL_DEFINE_STYLE(streets, streets) +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) // 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."); +// 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 { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + MGLStyleURL_emerald = [NSURL URLWithString:@"mapbox://styles/mapbox/emerald-v8"]; + }); + return MGLStyleURL_emerald; +} + @end diff --git a/platform/darwin/src/MGLTilePyramidOfflineRegion.mm b/platform/darwin/src/MGLTilePyramidOfflineRegion.mm index d1151de09..9b33d267d 100644 --- a/platform/darwin/src/MGLTilePyramidOfflineRegion.mm +++ b/platform/darwin/src/MGLTilePyramidOfflineRegion.mm @@ -33,7 +33,7 @@ - (instancetype)initWithStyleURL:(NSURL *)styleURL bounds:(MGLCoordinateBounds)bounds fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel { if (self = [super init]) { if (!styleURL) { - styleURL = [MGLStyle streetsStyleURL]; + styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; } if (!styleURL.scheme) { diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index b560535be..c3138058d 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,12 @@ Mapbox welcomes participation and contributions from everyone. If you’d like to do so please see [CONTRIBUTING.md](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started. +## 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)) +- 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)) + ## 3.2.1 - Fixed a hang that could occur if the host application attempts to set user defaults on a background queue. ([#4745](https://github.com/mapbox/mapbox-gl-native/pull/4745)) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 17323720a..8d6688e7e 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -276,7 +276,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) if ( ! styleURL) { - styleURL = [MGLStyle streetsStyleURL]; + styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; } if ( ! [styleURL scheme]) diff --git a/platform/osx/app/MainMenu.xib b/platform/osx/app/MainMenu.xib index 646c4ae40..3776d0d16 100644 --- a/platform/osx/app/MainMenu.xib +++ b/platform/osx/app/MainMenu.xib @@ -370,7 +370,7 @@ - + diff --git a/platform/osx/app/MapDocument.m b/platform/osx/app/MapDocument.m index 16d15c4ff..84c1fe4d6 100644 --- a/platform/osx/app/MapDocument.m +++ b/platform/osx/app/MapDocument.m @@ -121,22 +121,22 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { NSURL *styleURL; switch (tag) { case 1: - styleURL = [MGLStyle streetsStyleURL]; + styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; break; case 2: - styleURL = [MGLStyle emeraldStyleURL]; + styleURL = [MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion]; break; case 3: - styleURL = [MGLStyle lightStyleURL]; + styleURL = [MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion]; break; case 4: - styleURL = [MGLStyle darkStyleURL]; + styleURL = [MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion]; break; case 5: - styleURL = [MGLStyle satelliteStyleURL]; + styleURL = [MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion]; break; case 6: - styleURL = [MGLStyle hybridStyleURL]; + styleURL = [MGLStyle hybridStyleURLWithVersion:MGLStyleCurrentVersion]; break; default: NSAssert(NO, @"Cannot set style from control with tag %li", (long)tag); @@ -440,22 +440,22 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { NSCellStateValue state; switch (menuItem.tag) { case 1: - state = [styleURL isEqual:[MGLStyle streetsStyleURL]]; + state = [styleURL isEqual:[MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]]; break; case 2: - state = [styleURL isEqual:[MGLStyle emeraldStyleURL]]; + state = [styleURL isEqual:[MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion]]; break; case 3: - state = [styleURL isEqual:[MGLStyle lightStyleURL]]; + state = [styleURL isEqual:[MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion]]; break; case 4: - state = [styleURL isEqual:[MGLStyle darkStyleURL]]; + state = [styleURL isEqual:[MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion]]; break; case 5: - state = [styleURL isEqual:[MGLStyle satelliteStyleURL]]; + state = [styleURL isEqual:[MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion]]; break; case 6: - state = [styleURL isEqual:[MGLStyle hybridStyleURL]]; + state = [styleURL isEqual:[MGLStyle hybridStyleURLWithVersion:MGLStyleCurrentVersion]]; break; default: return NO; @@ -550,12 +550,12 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { } NSArray *styleURLs = @[ - [MGLStyle streetsStyleURL], - [MGLStyle emeraldStyleURL], - [MGLStyle lightStyleURL], - [MGLStyle darkStyleURL], - [MGLStyle satelliteStyleURL], - [MGLStyle hybridStyleURL], + [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion], + [MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion], + [MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion], + [MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion], + [MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion], + [MGLStyle hybridStyleURLWithVersion:MGLStyleCurrentVersion], ]; return [styleURLs indexOfObject:self.mapView.styleURL]; } diff --git a/platform/osx/app/MapDocument.xib b/platform/osx/app/MapDocument.xib index 74743ca9e..5b7e37936 100644 --- a/platform/osx/app/MapDocument.xib +++ b/platform/osx/app/MapDocument.xib @@ -1,7 +1,7 @@ - + - + @@ -69,7 +69,7 @@ - + diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm index 1ab98b9f8..899091c9f 100644 --- a/platform/osx/src/MGLMapView.mm +++ b/platform/osx/src/MGLMapView.mm @@ -491,7 +491,7 @@ public: - (nonnull NSURL *)styleURL { NSString *styleURLString = @(_mbglMap->getStyleURL().c_str()).mgl_stringOrNilIfEmpty; - return styleURLString ? [NSURL URLWithString:styleURLString] : [MGLStyle streetsStyleURL]; + return styleURLString ? [NSURL URLWithString:styleURLString] : [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; } - (void)setStyleURL:(nullable NSURL *)styleURL { @@ -506,7 +506,7 @@ public: if (![MGLAccountManager accessToken]) { return; } - styleURL = [MGLStyle streetsStyleURL]; + styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; } if (![styleURL scheme]) { diff --git a/platform/osx/test/MGLOfflineRegionTests.m b/platform/osx/test/MGLOfflineRegionTests.m index 63befdf14..5301b264a 100644 --- a/platform/osx/test/MGLOfflineRegionTests.m +++ b/platform/osx/test/MGLOfflineRegionTests.m @@ -14,7 +14,7 @@ - (void)testStyleURLs { MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); MGLTilePyramidOfflineRegion *region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:nil bounds:bounds fromZoomLevel:0 toZoomLevel:DBL_MAX]; - XCTAssertEqualObjects(region.styleURL, [MGLStyle streetsStyleURL], @"Streets isn’t the default style."); + XCTAssertEqualObjects(region.styleURL, [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion], @"Streets isn’t the default style."); NSURL *localURL = [NSURL URLWithString:@"beautiful.style"]; XCTAssertThrowsSpecificNamed([[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:localURL bounds:bounds fromZoomLevel:0 toZoomLevel:DBL_MAX], NSException, @"Invalid style URL", @"No exception raised when initializing region with a local file URL as the style URL."); @@ -22,7 +22,7 @@ - (void)testEquality { MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); - MGLTilePyramidOfflineRegion *original = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:[MGLStyle lightStyleURL] bounds:bounds fromZoomLevel:5 toZoomLevel:10]; + MGLTilePyramidOfflineRegion *original = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:[MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion] bounds:bounds fromZoomLevel:5 toZoomLevel:10]; MGLTilePyramidOfflineRegion *copy = [original copy]; XCTAssertEqualObjects(original, copy, @"Tile pyramid region should be equal to its copy."); diff --git a/platform/osx/test/MGLOfflineStorageTests.m b/platform/osx/test/MGLOfflineStorageTests.m index 8ffa1207c..53dc7f4a5 100644 --- a/platform/osx/test/MGLOfflineStorageTests.m +++ b/platform/osx/test/MGLOfflineStorageTests.m @@ -30,7 +30,7 @@ - (void)testAddPack { NSUInteger countOfPacks = [MGLOfflineStorage sharedOfflineStorage].packs.count; - NSURL *styleURL = [MGLStyle lightStyleURL]; + NSURL *styleURL = [MGLStyle lightStyleURLWithVersion:8]; /// Somewhere near Grape Grove, Ohio, United States. MGLCoordinateBounds bounds = { { 39.70358155855172, -83.69506472545841 }, diff --git a/platform/osx/test/MGLStyleTests.mm b/platform/osx/test/MGLStyleTests.mm index 69c9ef609..38ee1a511 100644 --- a/platform/osx/test/MGLStyleTests.mm +++ b/platform/osx/test/MGLStyleTests.mm @@ -1,29 +1,84 @@ #import "MGLStyle.h" +#import "NSBundle+MGLAdditions.h" + #import #pragma clang diagnostic ignored "-Wgnu-statement-expression" #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" #import +#import @interface MGLStyleTests : XCTestCase @end @implementation MGLStyleTests -- (void)testStyleURLs { - // Test that all the default styles have publicly-declared MGLStyle class - // methods and that the URLs are all well-formed. +- (void)testUnversionedStyleURLs { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" XCTAssertEqualObjects([MGLStyle streetsStyleURL].absoluteString, @(mbgl::util::default_styles::streets.url)); - XCTAssertEqualObjects([MGLStyle emeraldStyleURL].absoluteString, @(mbgl::util::default_styles::emerald.url)); + 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)); +#pragma clang diagnostic pop +} + +- (void)testVersionedStyleURLs { + // Test that all the default styles have publicly-declared MGLStyle class + // methods and that the URLs all have the right values. + XCTAssertEqualObjects([MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::streets.url)); + XCTAssertEqualObjects([MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::outdoors.url)); + 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)); static_assert(6 == mbgl::util::default_styles::numOrderedStyles, "MGLStyleTests isn’t testing all the styles in mbgl::util::default_styles."); } +- (void)testStyleURLComprehensiveness { + // Make sure this test is comprehensive. + const unsigned numImplicitArgs = 2 /* _cmd, self */; + unsigned numMethods = 0; + Method *methods = class_copyMethodList(object_getClass([MGLStyle class]), &numMethods); + unsigned numVersionedMethods = 0; + for (NSUInteger i = 0; i < numMethods; i++) { + Method method = methods[i]; + SEL selector = method_getName(method); + NSString *name = @(sel_getName(selector)); + unsigned numArgs = method_getNumberOfArguments(method); + if ([name hasSuffix:@"StyleURL"]) { + XCTAssertEqual(numArgs, numImplicitArgs, @"Unversioned style URL method should have no parameters, but it has %u.", numArgs - numImplicitArgs); + } else if ([name hasSuffix:@"StyleURLWithVersion:"]) { + XCTAssertEqual(numArgs, numImplicitArgs + 1, @"Versioned style URL method should have one parameter, but it has %u.", numArgs - numImplicitArgs); + numVersionedMethods++; + } else { + XCTAssertEqual([name rangeOfString:@"URL"].location, NSNotFound, @"MGLStyle style URL method %@ is malformed.", name); + } + } + XCTAssertEqual(mbgl::util::default_styles::numOrderedStyles, numVersionedMethods, + @"There are %lu default styles but MGLStyleTests only provides versioned style URL methods for %u of them.", + mbgl::util::default_styles::numOrderedStyles, numVersionedMethods); + + // Test that all the versioned style methods are in the public header. + NSURL *styleHeaderURL = [[[NSBundle mgl_frameworkBundle].bundleURL + URLByAppendingPathComponent:@"Headers" isDirectory:YES] + URLByAppendingPathComponent:@"MGLStyle.h"]; + NSError *styleHeaderError; + NSString *styleHeader = [NSString stringWithContentsOfURL:styleHeaderURL usedEncoding:nil error:&styleHeaderError]; + XCTAssertNil(styleHeaderError, @"Error getting contents of MGLStyle.h."); + + NSError *versionedMethodError; + NSString *versionedMethodExpressionString = @(R"RE(^\+\s*\(NSURL\s*\*\s*\)\s*\w+StyleURLWithVersion\s*:\s*\(\s*NSInteger\s*\)\s*version\s*;)RE"); + NSRegularExpression *versionedMethodExpression = [NSRegularExpression regularExpressionWithPattern:versionedMethodExpressionString options:NSRegularExpressionAnchorsMatchLines error:&versionedMethodError]; + XCTAssertNil(versionedMethodError, @"Error compiling regular expression to search for versioned methods."); + NSUInteger numVersionedMethodDeclarations = [versionedMethodExpression numberOfMatchesInString:styleHeader options:0 range:NSMakeRange(0, styleHeader.length)]; + XCTAssertEqual(numVersionedMethodDeclarations, numVersionedMethods); +} + @end diff --git a/src/mbgl/util/default_styles.cpp b/src/mbgl/util/default_styles.cpp index d051fc60c..247b7320e 100644 --- a/src/mbgl/util/default_styles.cpp +++ b/src/mbgl/util/default_styles.cpp @@ -4,12 +4,12 @@ namespace mbgl { namespace util { namespace default_styles { -const DefaultStyle streets = { "mapbox://styles/mapbox/streets-v8", "Streets" }; -const DefaultStyle emerald = { "mapbox://styles/mapbox/emerald-v8", "Emerald" }; -const DefaultStyle light = { "mapbox://styles/mapbox/light-v8", "Light" }; -const DefaultStyle dark = { "mapbox://styles/mapbox/dark-v8", "Dark" }; -const DefaultStyle satellite = { "mapbox://styles/mapbox/satellite-v8", "Satellite" }; -const DefaultStyle hybrid = { "mapbox://styles/mapbox/satellite-hybrid-v8", "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 hybrid = { "mapbox://styles/mapbox/satellite-hybrid-v9", "Hybrid" }; } // namespace default_styles } // end namespace util From f7f6f775f47d65923702f48aa184af37818f8ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 2 May 2016 14:22:16 -0700 Subject: [PATCH 07/13] [ios, osx] Pin unversioned style URL APIs to v8 styles Cherry-picked from 4a112c00f1634be40d10aa4797ac8e9262b8711a. --- platform/darwin/include/MGLStyle.h | 12 ++++++------ platform/darwin/src/MGLStyle.mm | 2 +- platform/ios/CHANGELOG.md | 2 +- platform/osx/test/MGLStyleTests.mm | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/platform/darwin/include/MGLStyle.h b/platform/darwin/include/MGLStyle.h index 2a2d61657..798bc1cf1 100644 --- a/platform/darwin/include/MGLStyle.h +++ b/platform/darwin/include/MGLStyle.h @@ -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. */ diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index c906337a5..c0d871487 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -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; \ } \ diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index c3138058d..e9e2c7b12 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -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)) diff --git a/platform/osx/test/MGLStyleTests.mm b/platform/osx/test/MGLStyleTests.mm index 38ee1a511..21efa12c1 100644 --- a/platform/osx/test/MGLStyleTests.mm +++ b/platform/osx/test/MGLStyleTests.mm @@ -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 } From bac6fb4f84e02f54b7e5b54ff250ba3bad36806c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 2 May 2016 14:26:13 -0700 Subject: [PATCH 08/13] [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. Cherry-picked from 5ccb43477fc1d2028aef283d0db64848ebc9a347. --- include/mbgl/util/default_styles.hpp | 4 ++-- platform/darwin/include/MGLStyle.h | 12 ++++++------ platform/darwin/src/MGLStyle.mm | 12 +++++++++++- platform/ios/CHANGELOG.md | 1 + platform/osx/app/MainMenu.xib | 2 +- platform/osx/app/MapDocument.m | 6 +++--- platform/osx/app/MapDocument.xib | 6 +++--- platform/osx/test/MGLStyleTests.mm | 2 +- src/mbgl/util/default_styles.cpp | 12 ++++++------ 9 files changed, 34 insertions(+), 23 deletions(-) diff --git a/include/mbgl/util/default_styles.hpp b/include/mbgl/util/default_styles.hpp index 2043dd3f5..05015ab4c 100644 --- a/include/mbgl/util/default_styles.hpp +++ b/include/mbgl/util/default_styles.hpp @@ -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); diff --git a/platform/darwin/include/MGLStyle.h b/platform/darwin/include/MGLStyle.h index 798bc1cf1..124954fee 100644 --- a/platform/darwin/include/MGLStyle.h +++ b/platform/darwin/include/MGLStyle.h @@ -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; diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index c0d871487..13404c8d0 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -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 { diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e9e2c7b12..a12fa0244 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -7,6 +7,7 @@ Mapbox welcomes participation and contributions from everyone. If you’d like - 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)) ## 3.2.1 diff --git a/platform/osx/app/MainMenu.xib b/platform/osx/app/MainMenu.xib index 3776d0d16..b9934be5e 100644 --- a/platform/osx/app/MainMenu.xib +++ b/platform/osx/app/MainMenu.xib @@ -390,7 +390,7 @@ - + diff --git a/platform/osx/app/MapDocument.m b/platform/osx/app/MapDocument.m index 84c1fe4d6..514e49b8d 100644 --- a/platform/osx/app/MapDocument.m +++ b/platform/osx/app/MapDocument.m @@ -136,7 +136,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); @@ -455,7 +455,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; @@ -555,7 +555,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]; } diff --git a/platform/osx/app/MapDocument.xib b/platform/osx/app/MapDocument.xib index 5b7e37936..e6891098d 100644 --- a/platform/osx/app/MapDocument.xib +++ b/platform/osx/app/MapDocument.xib @@ -59,9 +59,9 @@ - + - + @@ -77,7 +77,7 @@ - + diff --git a/platform/osx/test/MGLStyleTests.mm b/platform/osx/test/MGLStyleTests.mm index 21efa12c1..4b1ca1543 100644 --- a/platform/osx/test/MGLStyleTests.mm +++ b/platform/osx/test/MGLStyleTests.mm @@ -35,7 +35,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."); diff --git a/src/mbgl/util/default_styles.cpp b/src/mbgl/util/default_styles.cpp index 247b7320e..17cc2f574 100644 --- a/src/mbgl/util/default_styles.cpp +++ b/src/mbgl/util/default_styles.cpp @@ -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 From ca76b5b8030896692844a30199e5941bc0d7eba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 2 May 2016 15:34:46 -0700 Subject: [PATCH 09/13] [ios, osx] Renamed version constant, linked to more info MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renamed MGLStyleCurrentVersion to MGLStyleDefaultVersion to emphasize the constant’s role as an indicator of the default version used by SDK classes, which may be behind depending on release schedules. In the documentation for each style URL method, include the actual version number instead of the constant. In unit tests, verify that this documentation is in sync with the constant. Link each style URL method’s documentation to a forthcoming webpage on mapbox.com that describes the style in rich detail. Cherry-picked from 2ec95bc490c5793b7b8a3aa9999f48d196ca8085. --- .jazzy.yaml | 2 +- platform/darwin/include/MGLStyle.h | 74 ++++++++++--------- platform/darwin/src/MGLStyle.mm | 2 +- .../darwin/src/MGLTilePyramidOfflineRegion.mm | 2 +- platform/ios/src/MGLMapView.mm | 2 +- platform/osx/app/MapDocument.m | 36 ++++----- platform/osx/src/MGLMapView.mm | 4 +- platform/osx/test/MGLOfflineRegionTests.m | 4 +- platform/osx/test/MGLStyleTests.mm | 46 ++++++++---- 9 files changed, 97 insertions(+), 75 deletions(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index 116ee52c7..2d67307c5 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -22,7 +22,7 @@ custom_categories: - MGLMapView - MGLMapViewDelegate - MGLStyle - - MGLStyleCurrentVersion + - MGLStyleDefaultVersion - MGLUserTrackingMode - name: Annotations children: diff --git a/platform/darwin/include/MGLStyle.h b/platform/darwin/include/MGLStyle.h index 124954fee..22b69464c 100644 --- a/platform/darwin/include/MGLStyle.h +++ b/platform/darwin/include/MGLStyle.h @@ -5,112 +5,116 @@ NS_ASSUME_NONNULL_BEGIN /** - A version number identifying the latest released version of the suite of default styles provided by Mapbox. This version number may be passed into one of the “StyleURLWithVersion” class methods of MGLStyle. + A version number identifying the default version of the suite of default styles provided by Mapbox. This version number may be passed into one of the “StyleURLWithVersion” class methods of MGLStyle. - The value of this constant is current as of the date on which this SDK was published. Consult the Mapbox Styles API documentation for the most up-to-date style versioning information. + The value of this constant generally corresponds to the latest released version as of the date on which this SDK was published. You can use this constant to ascertain the style used by `MGLMapView` and `MGLTilePyramidOfflineRegion` when no style URL is specified. Consult the Mapbox Styles API documentation for the most up-to-date style versioning information. - @warning The value of this constant may change in a future release of the SDK. If you use any feature that depends on a specific implementation detail in a default style, you may use the current value of this constant or the underlying style URL, but do not use the constant itself. Such implementation details may change significantly from version to version. + @warning The value of this constant may change in a future release of the SDK. If you use any feature that depends on a specific aspect of a default style – for instance, the minimum zoom level that includes roads – you may use the current value of this constant or the underlying style URL, but do not use the constant itself. Such details may change significantly from version to version. */ -static const NSInteger MGLStyleCurrentVersion = 9; +static const NSInteger MGLStyleDefaultVersion = 9; /** - A collection of convenience methods for creating style URLs of default styles provided by Mapbox. + A collection of convenience methods for creating style URLs of default styles provided by Mapbox. Learn more about Mapbox default styles. */ @interface MGLStyle : NSObject /** - Returns the URL to version 8 of the Streets style. + Returns the URL to version 8 of the Mapbox Streets style. - Mapbox Streets is a complete base map that balances nature, commerce, and infrastructure. + Streets is a complete base map that balances nature, commerce, and infrastructure. + + `MGLMapView` and `MGLTilePyramidOfflineRegion` use Mapbox Streets when no style is specified explicitly. */ + (NSURL *)streetsStyleURL __attribute__((deprecated("Use -streetsStyleURLWithVersion:."))); /** - Returns the URL to the given version of the Streets style. + Returns the URL to the given version of the Mapbox Streets style. - Mapbox Streets is a complete base map that balances nature, commerce, and infrastructure. + Streets is a complete base map that balances nature, commerce, and infrastructure. - @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. + `MGLMapView` and `MGLTilePyramidOfflineRegion` use Mapbox Streets when no style is specified explicitly. + + @param version The style’s latest released version. As of publication, the current version is `9`. */ + (NSURL *)streetsStyleURLWithVersion:(NSInteger)version; /** - Returns the URL to version 8 of the Emerald style. + Returns the URL to version 8 of the Mapbox Emerald style. - Mapbox Emerald is a versatile style with emphasis on road networks and public transportation. + Emerald is a versatile style with emphasis on road networks and public transportation. */ + (NSURL *)emeraldStyleURL __attribute__((deprecated("Use ."))); /** - Returns the URL to the given version of the Outdoors style. + Returns the URL to the given version of the Mapbox Outdoors style. - Mapbox Outdoors is a rugged style that emphasizes physical terrain and outdoor activities. + Outdoors is a rugged style that emphasizes physical terrain and outdoor activities. - @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. + @param version The style’s latest released version. As of publication, the current version is `9`. */ + (NSURL *)outdoorsStyleURLWithVersion:(NSInteger)version; /** - Returns the URL to version 8 of the Light style. + Returns the URL to version 8 of the Mapbox Light style. - Mapbox Light is a subtle, light-colored backdrop for data visualizations. + Light is a subtle, light-colored backdrop for data visualizations. */ + (NSURL *)lightStyleURL __attribute__((deprecated("Use -lightStyleURLWithVersion:."))); /** - Returns the URL to the given version of the Light style. + Returns the URL to the given version of the Mapbox Light style. - Mapbox Light is a subtle, light-colored backdrop for data visualizations. + Light is a subtle, light-colored backdrop for data visualizations. - @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. + @param version The style’s latest released version. As of publication, the current version is `9`. */ + (NSURL *)lightStyleURLWithVersion:(NSInteger)version; /** - Returns the URL to version 8 of the Dark style. + Returns the URL to version 8 of the Mapbox Dark style. - Mapbox Dark is a subtle, dark-colored backdrop for data visualizations. + Dark is a subtle, dark-colored backdrop for data visualizations. */ + (NSURL *)darkStyleURL __attribute__((deprecated("Use -darkStyleURLWithVersion:."))); /** - Returns the URL to the given version of the Dark style. + Returns the URL to the given version of the Mapbox Dark style. - Mapbox Dark is a subtle, dark-colored backdrop for data visualizations. + Dark is a subtle, dark-colored backdrop for data visualizations. - @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. + @param version The style’s latest released version. As of publication, the current version is `9`. */ + (NSURL *)darkStyleURLWithVersion:(NSInteger)version; /** - Returns the URL to version 8 of the Satellite style. + Returns the URL to version 8 of the Mapbox Satellite style. - Mapbox Satellite is a beautiful global satellite and aerial imagery layer. + Satellite is a beautiful global satellite and aerial imagery layer. */ + (NSURL *)satelliteStyleURL __attribute__((deprecated("Use -satelliteStyleURLWithVersion:."))); /** - Returns the URL to the given version of the Satellite style. + Returns the URL to the given version of the Mapbox Satellite style. - Mapbox Satellite is a beautiful global satellite and aerial imagery layer. + Satellite is a beautiful global satellite and aerial imagery layer. - @param version The style’s latest released version. The current version is given by `MGLStyleCurrentVersion`. + @param version The style’s latest released version. As of publication, the current version is `9`. */ + (NSURL *)satelliteStyleURLWithVersion:(NSInteger)version; /** - Returns the URL to version 8 of the Satellite Streets style. + Returns the URL to version 8 of the Mapbox Satellite Streets style. - Mapbox Satellite Streets combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels and translucent roads from Mapbox Streets. + 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 -satelliteStreetsStyleURLWithVersion:."))); /** - Returns the URL to the given version of the Satellite Streets style. + Returns the URL to the given version of the Mapbox Satellite Streets style. - Mapbox Satellite Streets combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels and translucent roads from Mapbox Streets. + 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`. + @param version The style’s latest released version. As of publication, the current version is `9`. */ + (NSURL *)satelliteStreetsStyleURLWithVersion:(NSInteger)version; diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index 13404c8d0..347fc2be2 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -4,7 +4,7 @@ @implementation MGLStyle -static_assert(mbgl::util::default_styles::currentVersion == MGLStyleCurrentVersion, "mbgl::util::default_styles::currentVersion and MGLStyleCurrentVersion disagree."); +static_assert(mbgl::util::default_styles::currentVersion == MGLStyleDefaultVersion, "mbgl::util::default_styles::currentVersion and MGLStyleDefaultVersion disagree."); /// @param name The style’s marketing name, written in lower camelCase. /// @param fileName The last path component in the style’s URL, excluding the version suffix. diff --git a/platform/darwin/src/MGLTilePyramidOfflineRegion.mm b/platform/darwin/src/MGLTilePyramidOfflineRegion.mm index 9b33d267d..f128fbb25 100644 --- a/platform/darwin/src/MGLTilePyramidOfflineRegion.mm +++ b/platform/darwin/src/MGLTilePyramidOfflineRegion.mm @@ -33,7 +33,7 @@ - (instancetype)initWithStyleURL:(NSURL *)styleURL bounds:(MGLCoordinateBounds)bounds fromZoomLevel:(double)minimumZoomLevel toZoomLevel:(double)maximumZoomLevel { if (self = [super init]) { if (!styleURL) { - styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]; } if (!styleURL.scheme) { diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 8d6688e7e..359827ae6 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -276,7 +276,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration) if ( ! styleURL) { - styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]; } if ( ! [styleURL scheme]) diff --git a/platform/osx/app/MapDocument.m b/platform/osx/app/MapDocument.m index 514e49b8d..e7488cf00 100644 --- a/platform/osx/app/MapDocument.m +++ b/platform/osx/app/MapDocument.m @@ -121,22 +121,22 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { NSURL *styleURL; switch (tag) { case 1: - styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]; break; case 2: - styleURL = [MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion]; break; case 3: - styleURL = [MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion]; break; case 4: - styleURL = [MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion]; break; case 5: - styleURL = [MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion]; break; case 6: - styleURL = [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion]; break; default: NSAssert(NO, @"Cannot set style from control with tag %li", (long)tag); @@ -440,22 +440,22 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { NSCellStateValue state; switch (menuItem.tag) { case 1: - state = [styleURL isEqual:[MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]]; + state = [styleURL isEqual:[MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]]; break; case 2: - state = [styleURL isEqual:[MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion]]; + state = [styleURL isEqual:[MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion]]; break; case 3: - state = [styleURL isEqual:[MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion]]; + state = [styleURL isEqual:[MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion]]; break; case 4: - state = [styleURL isEqual:[MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion]]; + state = [styleURL isEqual:[MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion]]; break; case 5: - state = [styleURL isEqual:[MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion]]; + state = [styleURL isEqual:[MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion]]; break; case 6: - state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion]]; + state = [styleURL isEqual:[MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion]]; break; default: return NO; @@ -550,12 +550,12 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { } NSArray *styleURLs = @[ - [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion], - [MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion], - [MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion], - [MGLStyle darkStyleURLWithVersion:MGLStyleCurrentVersion], - [MGLStyle satelliteStyleURLWithVersion:MGLStyleCurrentVersion], - [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion], + [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion], + [MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion], + [MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion], + [MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion], + [MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion], + [MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion], ]; return [styleURLs indexOfObject:self.mapView.styleURL]; } diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm index 899091c9f..a247832fe 100644 --- a/platform/osx/src/MGLMapView.mm +++ b/platform/osx/src/MGLMapView.mm @@ -491,7 +491,7 @@ public: - (nonnull NSURL *)styleURL { NSString *styleURLString = @(_mbglMap->getStyleURL().c_str()).mgl_stringOrNilIfEmpty; - return styleURLString ? [NSURL URLWithString:styleURLString] : [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; + return styleURLString ? [NSURL URLWithString:styleURLString] : [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]; } - (void)setStyleURL:(nullable NSURL *)styleURL { @@ -506,7 +506,7 @@ public: if (![MGLAccountManager accessToken]) { return; } - styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion]; + styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion]; } if (![styleURL scheme]) { diff --git a/platform/osx/test/MGLOfflineRegionTests.m b/platform/osx/test/MGLOfflineRegionTests.m index 5301b264a..321485feb 100644 --- a/platform/osx/test/MGLOfflineRegionTests.m +++ b/platform/osx/test/MGLOfflineRegionTests.m @@ -14,7 +14,7 @@ - (void)testStyleURLs { MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); MGLTilePyramidOfflineRegion *region = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:nil bounds:bounds fromZoomLevel:0 toZoomLevel:DBL_MAX]; - XCTAssertEqualObjects(region.styleURL, [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion], @"Streets isn’t the default style."); + XCTAssertEqualObjects(region.styleURL, [MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion], @"Streets isn’t the default style."); NSURL *localURL = [NSURL URLWithString:@"beautiful.style"]; XCTAssertThrowsSpecificNamed([[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:localURL bounds:bounds fromZoomLevel:0 toZoomLevel:DBL_MAX], NSException, @"Invalid style URL", @"No exception raised when initializing region with a local file URL as the style URL."); @@ -22,7 +22,7 @@ - (void)testEquality { MGLCoordinateBounds bounds = MGLCoordinateBoundsMake(kCLLocationCoordinate2DInvalid, kCLLocationCoordinate2DInvalid); - MGLTilePyramidOfflineRegion *original = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:[MGLStyle lightStyleURLWithVersion:MGLStyleCurrentVersion] bounds:bounds fromZoomLevel:5 toZoomLevel:10]; + MGLTilePyramidOfflineRegion *original = [[MGLTilePyramidOfflineRegion alloc] initWithStyleURL:[MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion] bounds:bounds fromZoomLevel:5 toZoomLevel:10]; MGLTilePyramidOfflineRegion *copy = [original copy]; XCTAssertEqualObjects(original, copy, @"Tile pyramid region should be equal to its copy."); diff --git a/platform/osx/test/MGLStyleTests.mm b/platform/osx/test/MGLStyleTests.mm index 4b1ca1543..1b6b43254 100644 --- a/platform/osx/test/MGLStyleTests.mm +++ b/platform/osx/test/MGLStyleTests.mm @@ -1,6 +1,6 @@ #import "MGLStyle.h" -#import "NSBundle+MGLAdditions.h" +#import "../../darwin/src/NSBundle+MGLAdditions.h" #import @@ -30,18 +30,18 @@ - (void)testVersionedStyleURLs { // Test that all the default styles have publicly-declared MGLStyle class // methods and that the URLs all have the right values. - XCTAssertEqualObjects([MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::streets.url)); - XCTAssertEqualObjects([MGLStyle outdoorsStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::outdoors.url)); - 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 satelliteStreetsStyleURLWithVersion:MGLStyleCurrentVersion].absoluteString, @(mbgl::util::default_styles::satelliteStreets.url)); + XCTAssertEqualObjects([MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::streets.url)); + XCTAssertEqualObjects([MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::outdoors.url)); + XCTAssertEqualObjects([MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::light.url)); + XCTAssertEqualObjects([MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::dark.url)); + XCTAssertEqualObjects([MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::satellite.url)); + XCTAssertEqualObjects([MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion].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."); } -- (void)testStyleURLComprehensiveness { +- (void)testStyleURLDeclarations { // Make sure this test is comprehensive. const unsigned numImplicitArgs = 2 /* _cmd, self */; unsigned numMethods = 0; @@ -66,12 +66,7 @@ mbgl::util::default_styles::numOrderedStyles, numVersionedMethods); // Test that all the versioned style methods are in the public header. - NSURL *styleHeaderURL = [[[NSBundle mgl_frameworkBundle].bundleURL - URLByAppendingPathComponent:@"Headers" isDirectory:YES] - URLByAppendingPathComponent:@"MGLStyle.h"]; - NSError *styleHeaderError; - NSString *styleHeader = [NSString stringWithContentsOfURL:styleHeaderURL usedEncoding:nil error:&styleHeaderError]; - XCTAssertNil(styleHeaderError, @"Error getting contents of MGLStyle.h."); + NSString *styleHeader = self.stringWithContentsOfStyleHeader; NSError *versionedMethodError; NSString *versionedMethodExpressionString = @(R"RE(^\+\s*\(NSURL\s*\*\s*\)\s*\w+StyleURLWithVersion\s*:\s*\(\s*NSInteger\s*\)\s*version\s*;)RE"); @@ -79,6 +74,29 @@ XCTAssertNil(versionedMethodError, @"Error compiling regular expression to search for versioned methods."); NSUInteger numVersionedMethodDeclarations = [versionedMethodExpression numberOfMatchesInString:styleHeader options:0 range:NSMakeRange(0, styleHeader.length)]; XCTAssertEqual(numVersionedMethodDeclarations, numVersionedMethods); + + // Test that “current version is” statements are present and current for all versioned style methods. + NSError *versionError; + NSString *versionExpressionString = @(R"RE(the current version is `(\d+)`)RE"); + NSRegularExpression *versionExpression = [NSRegularExpression regularExpressionWithPattern:versionExpressionString options:0 error:&versionError]; + XCTAssertNil(versionError, @"Error compiling regular expression to search for current version statements."); + NSUInteger numVersionDeclarations = [versionExpression numberOfMatchesInString:styleHeader options:0 range:NSMakeRange(0, styleHeader.length)]; + XCTAssertEqual(numVersionDeclarations, numVersionedMethods); + [versionExpression enumerateMatchesInString:styleHeader options:0 range:NSMakeRange(0, styleHeader.length) usingBlock:^(NSTextCheckingResult * _Nullable result, __unused NSMatchingFlags flags, __unused BOOL * _Nonnull stop) { + XCTAssertEqual(result.numberOfRanges, 2U, @"Regular expression should have one capture group."); + NSString *version = [styleHeader substringWithRange:[result rangeAtIndex:1]]; + XCTAssertEqual([version integerValue], MGLStyleDefaultVersion, @"Versioned style URL method should document current version as %ld, not %ld.", MGLStyleDefaultVersion, version.integerValue); + }]; +} + +- (NSString *)stringWithContentsOfStyleHeader { + NSURL *styleHeaderURL = [[[NSBundle mgl_frameworkBundle].bundleURL + URLByAppendingPathComponent:@"Headers" isDirectory:YES] + URLByAppendingPathComponent:@"MGLStyle.h"]; + NSError *styleHeaderError; + NSString *styleHeader = [NSString stringWithContentsOfURL:styleHeaderURL usedEncoding:nil error:&styleHeaderError]; + XCTAssertNil(styleHeaderError, @"Error getting contents of MGLStyle.h."); + return styleHeader; } @end From 8ecb20610bc633ee6201bc2b0a668301140d8fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Tue, 3 May 2016 15:40:23 -0700 Subject: [PATCH 10/13] [osx] Test against literal style URL strings The default_style constants are no longer linked into the SDK, so the tests need to specify the strings literally. Any change to the URLs without corresponding symbol changes would be bugs in core, not the SDK, anyways. --- platform/osx/test/MGLStyleTests.mm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/osx/test/MGLStyleTests.mm b/platform/osx/test/MGLStyleTests.mm index 1b6b43254..d08376bb5 100644 --- a/platform/osx/test/MGLStyleTests.mm +++ b/platform/osx/test/MGLStyleTests.mm @@ -30,12 +30,12 @@ - (void)testVersionedStyleURLs { // Test that all the default styles have publicly-declared MGLStyle class // methods and that the URLs all have the right values. - XCTAssertEqualObjects([MGLStyle streetsStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::streets.url)); - XCTAssertEqualObjects([MGLStyle outdoorsStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::outdoors.url)); - XCTAssertEqualObjects([MGLStyle lightStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::light.url)); - XCTAssertEqualObjects([MGLStyle darkStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::dark.url)); - XCTAssertEqualObjects([MGLStyle satelliteStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::satellite.url)); - XCTAssertEqualObjects([MGLStyle satelliteStreetsStyleURLWithVersion:MGLStyleDefaultVersion].absoluteString, @(mbgl::util::default_styles::satelliteStreets.url)); + XCTAssertEqualObjects([MGLStyle streetsStyleURLWithVersion:99].absoluteString, @"mapbox://styles/mapbox/streets-v99"); + XCTAssertEqualObjects([MGLStyle outdoorsStyleURLWithVersion:99].absoluteString, @"mapbox://styles/mapbox/outdoors-v99"); + XCTAssertEqualObjects([MGLStyle lightStyleURLWithVersion:99].absoluteString, @"mapbox://styles/mapbox/light-v99"); + XCTAssertEqualObjects([MGLStyle darkStyleURLWithVersion:99].absoluteString, @"mapbox://styles/mapbox/dark-v99"); + XCTAssertEqualObjects([MGLStyle satelliteStyleURLWithVersion:99].absoluteString, @"mapbox://styles/mapbox/satellite-v99"); + XCTAssertEqualObjects([MGLStyle satelliteStreetsStyleURLWithVersion:99].absoluteString, @"mapbox://styles/mapbox/satellite-streets-v99"); static_assert(6 == mbgl::util::default_styles::numOrderedStyles, "MGLStyleTests isn’t testing all the styles in mbgl::util::default_styles."); From 6f981e9ba86d50dd2ac6c7477ab006aaa807ac2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Tue, 3 May 2016 17:04:25 -0700 Subject: [PATCH 11/13] [ios, osx] Revised style descriptions Revised style descriptions to be more consistent with how the styles are described on www.mapbox.com. Cherry-picked from 5035dc8418d931551bd58360bc82de2ae34cb066. --- platform/darwin/include/MGLStyle.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/darwin/include/MGLStyle.h b/platform/darwin/include/MGLStyle.h index 22b69464c..65d45dc98 100644 --- a/platform/darwin/include/MGLStyle.h +++ b/platform/darwin/include/MGLStyle.h @@ -21,7 +21,7 @@ static const NSInteger MGLStyleDefaultVersion = 9; /** Returns the URL to version 8 of the Mapbox Streets style. - Streets is a complete base map that balances nature, commerce, and infrastructure. + Streets is a general-purpose style with detailed road and transit networks. `MGLMapView` and `MGLTilePyramidOfflineRegion` use Mapbox Streets when no style is specified explicitly. */ @@ -30,7 +30,7 @@ static const NSInteger MGLStyleDefaultVersion = 9; /** Returns the URL to the given version of the Mapbox Streets style. - Streets is a complete base map that balances nature, commerce, and infrastructure. + Streets is a general-purpose style with detailed road and transit networks. `MGLMapView` and `MGLTilePyramidOfflineRegion` use Mapbox Streets when no style is specified explicitly. @@ -41,14 +41,14 @@ static const NSInteger MGLStyleDefaultVersion = 9; /** Returns the URL to version 8 of the Mapbox Emerald style. - Emerald is a versatile style with emphasis on road networks and public transportation. + Emerald is a tactile style with subtle textures and dramatic hillshading. */ -+ (NSURL *)emeraldStyleURL __attribute__((deprecated("Use ."))); ++ (NSURL *)emeraldStyleURL __attribute__((deprecated("Create an NSURL object with the string “mapbox://styles/mapbox/emerald-v8”."))); /** Returns the URL to the given version of the Mapbox Outdoors style. - Outdoors is a rugged style that emphasizes physical terrain and outdoor activities. + Outdoors is a general-purpose style tailored to outdoor activities. @param version The style’s latest released version. As of publication, the current version is `9`. */ @@ -89,14 +89,14 @@ static const NSInteger MGLStyleDefaultVersion = 9; /** Returns the URL to version 8 of the Mapbox Satellite style. - Satellite is a beautiful global satellite and aerial imagery layer. + Satellite is high-resolution satellite and aerial imagery. */ + (NSURL *)satelliteStyleURL __attribute__((deprecated("Use -satelliteStyleURLWithVersion:."))); /** Returns the URL to the given version of the Mapbox Satellite style. - Satellite is a beautiful global satellite and aerial imagery layer. + Satellite is high-resolution satellite and aerial imagery. @param version The style’s latest released version. As of publication, the current version is `9`. */ @@ -105,14 +105,14 @@ static const NSInteger MGLStyleDefaultVersion = 9; /** Returns the URL to version 8 of the Mapbox Satellite Streets style. - Satellite Streets combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels and translucent roads from Mapbox Streets. + Satellite Streets combines the high-resolution satellite and aerial imagery of Mapbox Satellite with unobtrusive labels and translucent roads from Mapbox Streets. */ + (NSURL *)hybridStyleURL __attribute__((deprecated("Use -satelliteStreetsStyleURLWithVersion:."))); /** Returns the URL to the given version of the Mapbox Satellite Streets style. - Satellite Streets combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels and translucent roads from Mapbox Streets. + Satellite Streets combines the high-resolution satellite and aerial imagery of Mapbox Satellite with unobtrusive labels and translucent roads from Mapbox Streets. @param version The style’s latest released version. As of publication, the current version is `9`. */ From 98113787b8b4b29a5728365c03904f91deb3f723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 6 May 2016 17:23:53 -0700 Subject: [PATCH 12/13] ios-v3.2.2-rc.1 --- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 86f19bf30..2d8b67566 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.2.1-symbols' + m.version = '3.2.2-rc.1-symbols' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.' diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 79ab6552b..18b84e0f9 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.2.1' + m.version = '3.2.2-rc.1' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.' From abe16952c6a4eedd8e258f53dee984a63048d0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Tue, 10 May 2016 10:52:50 -0700 Subject: [PATCH 13/13] ios-v3.2.2 --- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 2d8b67566..8f081f265 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.2.2-rc.1-symbols' + m.version = '3.2.2-symbols' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.' diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 18b84e0f9..086d4ddc4 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |m| m.name = 'Mapbox-iOS-SDK' - m.version = '3.2.2-rc.1' + m.version = '3.2.2' m.summary = 'Open source vector map solution for iOS with full styling capabilities.' m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.'