summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-19 21:15:30 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-05-06 10:57:54 -0700
commit2a4eeadb295775236fe1a89b50f9179b790b127a (patch)
tree8efffe60f9a2cff3abad624dc889b37809bb0194 /platform/ios
parentd28b6f37190dc1c9cbb1e3973f8a4534b507865c (diff)
downloadqtlocation-mapboxgl-2a4eeadb295775236fe1a89b50f9179b790b127a.tar.gz
[core, ios, osx] Version default style URL APIs; deprecated Emerald
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.
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/CHANGELOG.md3
-rw-r--r--platform/ios/app/MBXViewController.m18
-rw-r--r--platform/ios/jazzy.yml1
-rw-r--r--platform/ios/src/MGLMapView.mm2
4 files changed, 14 insertions, 10 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md
index 290df69aed..ffd60edb53 100644
--- a/platform/ios/CHANGELOG.md
+++ b/platform/ios/CHANGELOG.md
@@ -6,6 +6,9 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON
- Applications linking against the SDK static framework no longer need to add `-ObjC` to the Other Linker Flags (`OTHER_LDFLAGS`) build setting. If you previously added this flag solely for this SDK, removing the flag may potentially reduce the overall size of your application. ([#4641](https://github.com/mapbox/mapbox-gl-native/pull/4641))
- Removed the `armv7s` slice from the SDK to reduce its size. iPhone 5 and iPhone 5c automatically use the `armv7` slice instead. ([#4641](https://github.com/mapbox/mapbox-gl-native/pull/4641))
+- 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))
- The user dot now moves smoothly between user location updates while user location tracking is disabled. ([#1582](https://github.com/mapbox/mapbox-gl-native/pull/1582))
- An MGLAnnotation can be relocated by changing its `coordinate` property in a KVO-compliant way. An MGLMultiPoint cannot be relocated. ([#3835](https://github.com/mapbox/mapbox-gl-native/pull/3835))
- Setting the `image` property of an MGLAnnotationImage to `nil` resets it to the default red pin image and reclaims resources that can be used to customize additional annotations. ([#3835](https://github.com/mapbox/mapbox-gl-native/pull/3835))
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m
index 995f99072b..9b1d3d43bb 100644
--- a/platform/ios/app/MBXViewController.m
+++ b/platform/ios/app/MBXViewController.m
@@ -475,19 +475,19 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
dispatch_once(&onceToken, ^{
styleNames = @[
@"Streets",
- @"Emerald",
+ @"Outdoors",
@"Light",
@"Dark",
@"Satellite",
@"Hybrid",
];
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],
];
NSAssert(styleNames.count == styleURLs.count, @"Style names and URLs don’t match.");
@@ -497,10 +497,10 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = {
unsigned numStyleURLMethods = 0;
for (NSUInteger i = 0; i < numMethods; i++) {
Method method = methods[i];
- if (method_getNumberOfArguments(method) == 2 /* _cmd, self */) {
+ if (method_getNumberOfArguments(method) == 3 /* _cmd, self, version */) {
SEL selector = method_getName(method);
NSString *name = @(sel_getName(selector));
- if ([name rangeOfString:@"StyleURL"].location != NSNotFound) {
+ if ([name hasSuffix:@"StyleURLWithVersion:"]) {
numStyleURLMethods += 1;
}
}
diff --git a/platform/ios/jazzy.yml b/platform/ios/jazzy.yml
index 586d944f0c..205f0c7f4f 100644
--- a/platform/ios/jazzy.yml
+++ b/platform/ios/jazzy.yml
@@ -23,6 +23,7 @@ custom_categories:
- MGLMapView
- MGLMapViewDelegate
- MGLStyle
+ - MGLStyleCurrentVersion
- MGLUserTrackingMode
- name: Annotations
children:
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 8a3faa6a2e..2c3cbf8f5f 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -329,7 +329,7 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
if ( ! styleURL)
{
- styleURL = [MGLStyle streetsStyleURL];
+ styleURL = [MGLStyle streetsStyleURLWithVersion:MGLStyleCurrentVersion];
}
if ( ! [styleURL scheme])