From fdbcd47002d3d4b10df4a9b314616942a1249191 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Tue, 13 Feb 2018 15:14:44 -0500 Subject: [ios] Fix safeAreaInsets availability warning in MGLMapViewLayoutTests Fixes: 'safeAreaInsets' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] --- platform/ios/test/MGLMapViewLayoutTests.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/ios') diff --git a/platform/ios/test/MGLMapViewLayoutTests.m b/platform/ios/test/MGLMapViewLayoutTests.m index a41e7695f9..e707cfdb41 100644 --- a/platform/ios/test/MGLMapViewLayoutTests.m +++ b/platform/ios/test/MGLMapViewLayoutTests.m @@ -67,7 +67,7 @@ CGFloat bottomSafeAreaInset = 0.0; double accuracy = 0.01; - if ( [self.mapView respondsToSelector:@selector(safeAreaInsets)] ) { + if (@available(iOS 11.0, *)) { bottomSafeAreaInset = self.mapView.safeAreaInsets.bottom; } -- cgit v1.2.1 From 9989e71e3fe436d1a46e0f023adf0218fe777f83 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 16 Feb 2018 20:01:03 -0500 Subject: [ios] Fix loop when first asking for location permission (#11229) --- platform/ios/CHANGELOG.md | 6 +++++- platform/ios/src/MGLMapView.mm | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 19d6d36ace..3bfbbd4a18 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,7 +2,11 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. -## 3.7.4 +## 3.7.5 + +* Fixed an issue where requesting location services permission would trigger an unrecoverable loop. ([#11229](https://github.com/mapbox/mapbox-gl-native/pull/11229)) + +## 3.7.4 - February 12, 2018 * Added the `MGLTileSourceOptionTileCoordinateBounds` option to create an `MGLTileSource` that only supplies tiles within a specific geographic bounding box. ([#11141](https://github.com/mapbox/mapbox-gl-native/pull/11141)) * Fixed an issue that caused `-[MGLMapSnapshotter pointForCoordinate:]` to return the wrong point. ([#11035](https://github.com/mapbox/mapbox-gl-native/pull/11035)) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index f2141c3840..02f529d094 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -539,8 +539,9 @@ public: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willTerminate) name:UIApplicationWillTerminateNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sleepGL:) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wakeGL:) name:UIApplicationWillEnterForegroundNotification object:nil]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sleepGL:) name:UIApplicationWillResignActiveNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(wakeGL:) name:UIApplicationDidBecomeActiveNotification object:nil]; + // As of 3.7.5, we intentionally do not listen for `UIApplicationWillResignActiveNotification` or call `sleepGL:` in response to it, as doing + // so causes a loop when asking for location permission. See: https://github.com/mapbox/mapbox-gl-native/issues/11225 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveMemoryWarning) name:UIApplicationDidReceiveMemoryWarningNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChange:) name:UIDeviceOrientationDidChangeNotification object:nil]; -- cgit v1.2.1 From 9a30e252b53b654d9b756f839bd33f2ff6db1d91 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 16 Feb 2018 20:06:32 -0500 Subject: [ios] Bump podspecs for 3.7.5 --- platform/ios/CHANGELOG.md | 2 +- platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 3bfbbd4a18..7d23a3fbaf 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,7 +2,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. -## 3.7.5 +## 3.7.5 - February 16, 2018 * Fixed an issue where requesting location services permission would trigger an unrecoverable loop. ([#11229](https://github.com/mapbox/mapbox-gl-native/pull/11229)) diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec index 65adcf8d3c..bf2f854b50 100644 --- a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec +++ b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.4' + version = '3.7.5' m.name = 'Mapbox-iOS-SDK-nightly-dynamic' m.version = "#{version}-nightly" diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index fff485ebb4..e0c787e5da 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.4' + version = '3.7.5' m.name = 'Mapbox-iOS-SDK-symbols' m.version = "#{version}-symbols" diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 3181b66918..ea7ce47a8b 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.4' + version = '3.7.5' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1 From d425ec72379791ea47f1088e0c28fdf238cfc736 Mon Sep 17 00:00:00 2001 From: Molly Lloyd Date: Mon, 26 Feb 2018 14:12:59 -0800 Subject: [ios, macos] add tileset encoding option to darwin sources (#11274) * add tileset encoding option to darwin sources * correct style guide * link out to dem encoding docs * markdownify comments --- platform/ios/docs/guides/For Style Authors.md | 1 + 1 file changed, 1 insertion(+) (limited to 'platform/ios') diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md index 68d59fbc70..c4aabb0410 100644 --- a/platform/ios/docs/guides/For Style Authors.md +++ b/platform/ios/docs/guides/For Style Authors.md @@ -154,6 +154,7 @@ In style JSON | In TileJSON | In the SDK `tileSize` | — | `MGLTileSourceOptionTileSize` `attribution` | `attribution` | `MGLTileSourceOptionAttributionHTMLString` (but consider specifying `MGLTileSourceOptionAttributionInfos` instead for improved security) `scheme` | `scheme` | `MGLTileSourceOptionTileCoordinateSystem` +`encoding` | – | `MGLTileSourceOptionDEMEncoding` ### Shape sources -- cgit v1.2.1 From b74930c5fcf6b2a7652436fec9bcab4e12a49669 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Tue, 27 Feb 2018 15:46:28 -0500 Subject: [ios] Improved heading indicator arrow visibility --- platform/ios/CHANGELOG.md | 4 ++++ platform/ios/src/MGLUserLocationHeadingArrowLayer.m | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 7d23a3fbaf..e2052abb89 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## 3.7.6 + +* Improved the visibility of the heading indicator arrow. ([#11337](https://github.com/mapbox/mapbox-gl-native/pull/11337)) + ## 3.7.5 - February 16, 2018 * Fixed an issue where requesting location services permission would trigger an unrecoverable loop. ([#11229](https://github.com/mapbox/mapbox-gl-native/pull/11229)) diff --git a/platform/ios/src/MGLUserLocationHeadingArrowLayer.m b/platform/ios/src/MGLUserLocationHeadingArrowLayer.m index 912ce30c35..d81cb5a09a 100644 --- a/platform/ios/src/MGLUserLocationHeadingArrowLayer.m +++ b/platform/ios/src/MGLUserLocationHeadingArrowLayer.m @@ -3,7 +3,7 @@ #import "MGLFaux3DUserLocationAnnotationView.h" #import "MGLGeometry.h" -const CGFloat MGLUserLocationHeadingArrowSize = 6; +const CGFloat MGLUserLocationHeadingArrowSize = 8; @implementation MGLUserLocationHeadingArrowLayer -- cgit v1.2.1 From c815c1e2d661ae43584db0e6eed2a2aaf5fe7e14 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 8 Mar 2018 14:31:58 -0500 Subject: [ios] Fix pinch drift ignoring delegate camera change response --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e2052abb89..49b2add722 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -4,6 +4,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ## 3.7.6 +* Fixed an issue where the pinch gesture could drift beyond bounds imposed by `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]`. ([#11423](https://github.com/mapbox/mapbox-gl-native/pull/11423)) * Improved the visibility of the heading indicator arrow. ([#11337](https://github.com/mapbox/mapbox-gl-native/pull/11337)) ## 3.7.5 - February 16, 2018 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 02f529d094..0fae5e0394 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1459,10 +1459,12 @@ public: double zoom = log2(newScale); MGLMapCamera *toCamera = [self cameraByZoomingToZoomLevel:zoom aroundAnchorPoint:centerPoint]; - if ([self _shouldChangeFromCamera:oldCamera toCamera:toCamera]) + if ( ! [self _shouldChangeFromCamera:oldCamera toCamera:toCamera]) { drift = NO; - } else { + } + else + { if (drift) { _mbglMap->setZoom(zoom, mbgl::ScreenCoordinate { centerPoint.x, centerPoint.y }, MGLDurationFromTimeInterval(duration)); @@ -1695,7 +1697,9 @@ public: { [weakSelf unrotateIfNeededForGesture]; }]; - } else { + } + else + { [self unrotateIfNeededForGesture]; } } -- cgit v1.2.1 From e690e7cf1e91ba33017575ed9d068f2f38acab03 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 8 Mar 2018 14:52:43 -0500 Subject: [ios] Add camera limit debug option to iosapp Adapted from https://github.com/mapbox/ios-sdk-examples/blob/cdff47276d261d58c7eb2d0ba75d9cce6c308417/Examples/ObjectiveC/BlockingGesturesDelegateExample.m --- platform/ios/app/MBXViewController.m | 43 +++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'platform/ios') diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 1046644f8c..63b06af583 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -18,6 +18,11 @@ static const CLLocationCoordinate2D WorldTourDestinations[] = { { .latitude = -13.15589555, .longitude = -74.2178961777998 }, }; +static const MGLCoordinateBounds colorado = { + .sw = { .latitude = 36.986207, .longitude = -109.049896}, + .ne = { .latitude = 40.989329, .longitude = -102.062592}, +}; + static NSString * const MBXViewControllerAnnotationViewReuseIdentifer = @"MBXViewControllerAnnotationViewReuseIdentifer"; typedef NS_ENUM(NSInteger, MBXSettingsSections) { @@ -85,6 +90,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { MBXSettingsMiscellaneousToggleTwoMaps, MBXSettingsMiscellaneousCountryLabels, MBXSettingsMiscellaneousShowSnapshots, + MBXSettingsMiscellaneousShouldLimitCameraChanges, MBXSettingsMiscellaneousPrintLogFile, MBXSettingsMiscellaneousDeleteLogFile, }; @@ -122,6 +128,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @property (nonatomic) BOOL usingLocaleBasedCountryLabels; @property (nonatomic) BOOL reuseQueueStatsEnabled; @property (nonatomic) BOOL showZoomLevelEnabled; +@property (nonatomic) BOOL shouldLimitCameraChanges; @end @@ -363,7 +370,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @"Embedded Map View", [NSString stringWithFormat:@"%@ Second Map", ([self.view viewWithTag:2] == nil ? @"Show" : @"Hide")], [NSString stringWithFormat:@"Show Labels in %@", (_usingLocaleBasedCountryLabels ? @"Default Language" : [[NSLocale currentLocale] displayNameForKey:NSLocaleIdentifier value:[self bestLanguageForUser]])], - @"Show Snapshots" + @"Show Snapshots", + [NSString stringWithFormat:@"%@ Camera Changes", (_shouldLimitCameraChanges ? @"Unlimit" : @"Limit")], ]]; if (self.debugLoggingEnabled) @@ -652,6 +660,14 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self performSegueWithIdentifier:@"ShowSnapshots" sender:nil]; break; } + case MBXSettingsMiscellaneousShouldLimitCameraChanges: + { + self.shouldLimitCameraChanges = !self.shouldLimitCameraChanges; + if (self.shouldLimitCameraChanges) { + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(39.748947, -104.995882) zoomLevel:10 direction:0 animated:NO]; + } + break; + } default: NSAssert(NO, @"All miscellaneous setting rows should be implemented"); break; @@ -1880,6 +1896,31 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { _usingLocaleBasedCountryLabels = [[self bestLanguageForUser] isEqualToString:@"en"]; } +- (BOOL)mapView:(MGLMapView *)mapView shouldChangeFromCamera:(MGLMapCamera *)oldCamera toCamera:(MGLMapCamera *)newCamera { + if (_shouldLimitCameraChanges) { + // Get the current camera to restore it after. + MGLMapCamera *currentCamera = mapView.camera; + + // From the new camera obtain the center to test if it’s inside the boundaries. + CLLocationCoordinate2D newCameraCenter = newCamera.centerCoordinate; + + // Set the map’s visible bounds to newCamera. + mapView.camera = newCamera; + MGLCoordinateBounds newVisibleCoordinates = mapView.visibleCoordinateBounds; + + // Revert the camera. + mapView.camera = currentCamera; + + // Test if the newCameraCenter and newVisibleCoordinates are inside Colorado. + BOOL inside = MGLCoordinateInCoordinateBounds(newCameraCenter, colorado); + BOOL intersects = MGLCoordinateInCoordinateBounds(newVisibleCoordinates.ne, colorado) && MGLCoordinateInCoordinateBounds(newVisibleCoordinates.sw, colorado); + + return inside && intersects; + } else { + return YES; + } +} + - (void)mapViewRegionIsChanging:(MGLMapView *)mapView { [self updateHUD]; -- cgit v1.2.1 From 1b3d8f990f0ac524ad7142e31433717b1f8be81c Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 12 Mar 2018 13:57:22 -0400 Subject: [ios, build] Move iOS release builds to CircleCI --- platform/ios/bitrise.yml | 98 ---------------------------------------- platform/ios/scripts/document.sh | 2 +- 2 files changed, 1 insertion(+), 99 deletions(-) delete mode 100644 platform/ios/bitrise.yml (limited to 'platform/ios') diff --git a/platform/ios/bitrise.yml b/platform/ios/bitrise.yml deleted file mode 100644 index 24bd054dbc..0000000000 --- a/platform/ios/bitrise.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -format_version: 1.0.0 -default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git -trigger_map: -- pattern: nightly-release - workflow: nightly-release -- pattern: release-from-tag - workflow: release-from-tag -- pattern: "*" - is_pull_request_allowed: true - workflow: primary -workflows: - primary: - steps: - - script: - title: Skip Workflow - inputs: - - content: echo "This workflow is obsolete — see CircleCi." - nightly-release: - steps: - - script: - title: Install Dependencies - inputs: - - content: |- - #!/bin/bash - set -eu -o pipefail - brew install cmake - - is_debug: 'yes' - - script: - title: Configure AWS-CLI - inputs: - - content: |- - #!/bin/bash - pip install awscli - - script: - title: Build package - inputs: - - content: |- - #!/bin/bash - set -eu -o pipefail - export BUILDTYPE=Release - export BUILD_DEVICE=true - export FORMAT=dynamic - make ipackage-strip - CLOUDWATCH=true platform/ios/scripts/metrics.sh - platform/ios/scripts/deploy-nightly.sh - - is_debug: 'yes' - - slack: - title: Post to Slack - inputs: - - webhook_url: "$SLACK_HOOK_URL" - - channel: "#gl-bots" - - from_username: 'Bitrise iOS Nightly 💤' - - from_username_on_error: 'Bitrise iOS Nightly 💤' - - message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> - for - completed successfully.' - - message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> - for - failed.' - - icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png - - icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png - release-from-tag: - steps: - - script: - title: Install Dependencies - inputs: - - content: |- - #!/bin/bash - set -eu -o pipefail - brew install cmake - sudo easy_install pip - sudo pip install awscli - - is_debug: 'yes' - - script: - title: Build package - inputs: - - content: |- - #!/bin/bash - set -eu -o pipefail - export VERSION_TAG=${BITRISE_GIT_TAG} - platform/ios/scripts/deploy-packages.sh - - is_debug: 'yes' - - slack: - title: Post to Slack - inputs: - - webhook_url: "$SLACK_HOOK_URL" - - channel: "#gl-bots" - - from_username: 'Bitrise iOS Deploy' - - from_username_on_error: 'Bitrise iOS Deploy' - - message: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> - for - completed successfully.' - - message_on_error: '<${BITRISE_BUILD_URL}|Build #${BITRISE_BUILD_NUMBER}> - for - failed.' - - icon_url: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-icon-128.png - - icon_url_on_error: https://bitrise-public-content-production.s3.amazonaws.com/slack/bitrise-slack-error-icon-128.png diff --git a/platform/ios/scripts/document.sh b/platform/ios/scripts/document.sh index 57b596a4b9..43cbe3067a 100755 --- a/platform/ios/scripts/document.sh +++ b/platform/ios/scripts/document.sh @@ -6,7 +6,7 @@ set -u if [ -z `which jazzy` ]; then echo "Installing jazzy…" - gem install jazzy --no-rdoc --no-ri + gem install jazzy --no-document if [ -z `which jazzy` ]; then echo "Unable to install jazzy. See https://github.com/mapbox/mapbox-gl-native/blob/master/platform/ios/INSTALL.md" exit 1 -- cgit v1.2.1 From 40e5af700b387d4ff5dcec4b9f056bc4a7e8e383 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 12 Mar 2018 17:17:36 -0400 Subject: [ios] Prepare changelog for ios-v3.7.6 --- platform/ios/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 49b2add722..e7277a2e10 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,8 +2,11 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. -## 3.7.6 +## 3.7.6 - March 12, 2018 +* Fixed an issue where full-resolution tiles could fail to replace lower-resolution placeholders. ([#11227](https://github.com/mapbox/mapbox-gl-native/pull/11227)) +* Fixed an issue where tilesets with bounds that cover the entire world would fail to render. ([#11425](https://github.com/mapbox/mapbox-gl-native/pull/11425)) +* Fixed a memory leak in `MGLMapSnapshotter`. ([#11193](https://github.com/mapbox/mapbox-gl-native/pull/11193)) * Fixed an issue where the pinch gesture could drift beyond bounds imposed by `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]`. ([#11423](https://github.com/mapbox/mapbox-gl-native/pull/11423)) * Improved the visibility of the heading indicator arrow. ([#11337](https://github.com/mapbox/mapbox-gl-native/pull/11337)) -- cgit v1.2.1 From 4544b7aae9ab96ff89f3e46a1ee38ce0af95054f Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 12 Mar 2018 17:19:34 -0400 Subject: [ios] Bump podspecs for ios-v3.7.6 --- platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec index bf2f854b50..268b7b9da6 100644 --- a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec +++ b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.5' + version = '3.7.6' m.name = 'Mapbox-iOS-SDK-nightly-dynamic' m.version = "#{version}-nightly" diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index e0c787e5da..a1b2441d29 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.5' + version = '3.7.6' m.name = 'Mapbox-iOS-SDK-symbols' m.version = "#{version}-symbols" diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index ea7ce47a8b..7e696a23cf 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.5' + version = '3.7.6' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1 From c5625f988a37b6876c4ef5fc8d9de295ee28ed44 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Date: Mon, 23 Apr 2018 17:59:17 -0400 Subject: [ios, android] Resolve merge conflicts. --- platform/ios/CHANGELOG.md | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 9d8390803b..1775d628f6 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,7 +2,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. -## 4.0.1 +## master ### Style layers @@ -88,18 +88,6 @@ The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iO * Fixed an issue where requesting location services permission would trigger an unrecoverable loop. ([#11229](https://github.com/mapbox/mapbox-gl-native/pull/11229)) -## 3.7.6 - March 12, 2018 - -* Fixed an issue where full-resolution tiles could fail to replace lower-resolution placeholders. ([#11227](https://github.com/mapbox/mapbox-gl-native/pull/11227)) -* Fixed an issue where tilesets with bounds that cover the entire world would fail to render. ([#11425](https://github.com/mapbox/mapbox-gl-native/pull/11425)) -* Fixed a memory leak in `MGLMapSnapshotter`. ([#11193](https://github.com/mapbox/mapbox-gl-native/pull/11193)) -* Fixed an issue where the pinch gesture could drift beyond bounds imposed by `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]`. ([#11423](https://github.com/mapbox/mapbox-gl-native/pull/11423)) -* Improved the visibility of the heading indicator arrow. ([#11337](https://github.com/mapbox/mapbox-gl-native/pull/11337)) - -## 3.7.5 - February 16, 2018 - -* Fixed an issue where requesting location services permission would trigger an unrecoverable loop. ([#11229](https://github.com/mapbox/mapbox-gl-native/pull/11229)) - ## 3.7.4 - February 12, 2018 * Added the `MGLTileSourceOptionTileCoordinateBounds` option to create an `MGLTileSource` that only supplies tiles within a specific geographic bounding box. ([#11141](https://github.com/mapbox/mapbox-gl-native/pull/11141)) -- cgit v1.2.1 From c067865e7bcb1f8a8eec483a572fa874e5d15111 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 27 Apr 2018 12:25:49 -0400 Subject: [ios, macos] Update minimum deployment versions to iOS 9, macOS 10.11 (#11776) * [ios] Remove iOS 8 conditionals * [ios, macos] Bump pod deployment targets * [ios, macos] Add changelog entries * [ios, macos] Update docs * Remove unnecessary selector-based version checks * Update SQLite note * [ios, macos] Replace lightweight generics macros with direct use Lightweight generics for Foundation collections are available everywhere with the bump to iOS 9 and macOS 10.11. * Update deprecated macOS method --- platform/ios/CHANGELOG.md | 4 + platform/ios/DEVELOPING.md | 2 +- platform/ios/INSTALL.md | 3 +- .../ios/Mapbox-iOS-SDK-nightly-dynamic.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-static-part.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- .../ios/app/MBXOfflinePacksTableViewController.m | 6 +- platform/ios/app/MBXViewController.m | 11 +- platform/ios/benchmark/MBXBenchViewController.mm | 4 +- platform/ios/docs/doc-README.md | 2 +- platform/ios/docs/pod-README.md | 4 +- platform/ios/ios.xcodeproj/project.pbxproj | 16 +-- platform/ios/src/MGLAnnotationContainerView.h | 2 +- platform/ios/src/MGLAnnotationContainerView.m | 4 +- .../ios/src/MGLAnnotationContainerView_Private.h | 2 +- platform/ios/src/MGLMapAccessibilityElement.mm | 6 +- platform/ios/src/MGLMapView.h | 38 +++---- platform/ios/src/MGLMapView.mm | 118 ++++++++++----------- platform/ios/src/MGLMapViewDelegate.h | 2 +- platform/ios/src/MGLScaleBar.mm | 7 +- platform/ios/src/MGLUserLocation.m | 2 +- .../ios/test/MGLMapAccessibilityElementTests.m | 6 +- 23 files changed, 104 insertions(+), 143 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 1775d628f6..5c3686d7a8 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -4,6 +4,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ## master +### Packaging + +* The minimum deployment target for this SDK is now iOS 9.0. ([#11776](https://github.com/mapbox/mapbox-gl-native/pull/11776)) + ### Style layers * Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) diff --git a/platform/ios/DEVELOPING.md b/platform/ios/DEVELOPING.md index 7a97074d38..b407e78e4b 100644 --- a/platform/ios/DEVELOPING.md +++ b/platform/ios/DEVELOPING.md @@ -4,7 +4,7 @@ This document explains how to build the Mapbox Maps SDK for iOS from source. It ## Requirements -The Mapbox Maps SDK for iOS and iosapp demo application require iOS 8.0 or above. _Note: Support for iOS 8 will be removed in a future release and the minimum iOS deployment version will increase to iOS 9.0._ +The Mapbox Maps SDK for iOS and iosapp demo application require iOS 9.0 or above. The Mapbox Maps SDK for iOS requires Xcode 9.1 or above to compile from source. diff --git a/platform/ios/INSTALL.md b/platform/ios/INSTALL.md index 01f4621b1e..f253d3019d 100644 --- a/platform/ios/INSTALL.md +++ b/platform/ios/INSTALL.md @@ -4,13 +4,12 @@ This document explains how to build a development version of Mapbox Maps SDK for ### Requirements -The Mapbox Maps SDK for iOS is intended to run on iOS 8.0 and above on the following devices: +The Mapbox Maps SDK for iOS is intended to run on iOS 9.0 and above on the following devices: * iPhone 4s and above (5, 5c, 5s, 6, 6 Plus, 7, 7 Plus, 8, 8 Plus, X) * iPad 2 and above (3, 4, Mini, Air, Mini 2, Air 2, Pro) * iPod touch 5th generation and above -_Note: Support for iOS 8 will be removed in a future release and the minimum iOS deployment version will increase to iOS 9.0._ Note that 32-bit simulators (such as the iPhone 5 or iPad 2) are not supported. diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec index 7ea1b993ef..e07178311b 100644 --- a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec +++ b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |m| } m.platform = :ios - m.ios.deployment_target = '8.0' + m.ios.deployment_target = '9.0' m.requires_arc = true diff --git a/platform/ios/Mapbox-iOS-SDK-static-part.podspec b/platform/ios/Mapbox-iOS-SDK-static-part.podspec index b2a114f9d2..bd98bb7272 100644 --- a/platform/ios/Mapbox-iOS-SDK-static-part.podspec +++ b/platform/ios/Mapbox-iOS-SDK-static-part.podspec @@ -1,4 +1,4 @@ - m.ios.deployment_target = '8.0' + m.ios.deployment_target = '9.0' m.requires_arc = true diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 47a021598f..fbf65f0b24 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |m| } m.platform = :ios - m.ios.deployment_target = '8.0' + m.ios.deployment_target = '9.0' m.requires_arc = true diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 73412890c8..5a8e913dd9 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -20,7 +20,7 @@ Pod::Spec.new do |m| } m.platform = :ios - m.ios.deployment_target = '8.0' + m.ios.deployment_target = '9.0' m.requires_arc = true diff --git a/platform/ios/app/MBXOfflinePacksTableViewController.m b/platform/ios/app/MBXOfflinePacksTableViewController.m index 26a15a0b95..959ae57548 100644 --- a/platform/ios/app/MBXOfflinePacksTableViewController.m +++ b/platform/ios/app/MBXOfflinePacksTableViewController.m @@ -45,7 +45,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac [[NSNotificationCenter defaultCenter] removeObserver:self]; } -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NS_DICTIONARY_OF(NSString *, id) *)change context:(void *)context { +- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if ([keyPath isEqualToString:@"packs"]) { NSKeyValueChange changeKind = [change[NSKeyValueChangeKindKey] unsignedIntegerValue]; NSIndexSet *indices = change[NSKeyValueChangeIndexesKey]; @@ -119,9 +119,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac }]; }]; [alertController addAction:downloadAction]; - if ([alertController respondsToSelector:@selector(setPreferredAction:)]) { - alertController.preferredAction = downloadAction; - } + alertController.preferredAction = downloadAction; [self presentViewController:alertController animated:YES completion:nil]; } diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 391af5ea05..80163c7d40 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -175,9 +175,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { self.debugLoggingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsDebugLoggingEnabled"]; self.mapView.showsScale = YES; self.mapView.showsUserHeadingIndicator = YES; - if ([UIFont respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) { - self.hudLabel.titleLabel.font = [UIFont monospacedDigitSystemFontOfSize:10 weight:UIFontWeightRegular]; - } + self.hudLabel.titleLabel.font = [UIFont monospacedDigitSystemFontOfSize:10 weight:UIFontWeightRegular]; if ([MGLAccountManager accessToken].length) { @@ -207,11 +205,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self.mapView reloadStyle:self]; }]; [alertController addAction:OKAction]; + alertController.preferredAction = OKAction; - if ([alertController respondsToSelector:@selector(setPreferredAction:)]) - { - alertController.preferredAction = OKAction; - } [self presentViewController:alertController animated:YES completion:nil]; } } @@ -1532,7 +1527,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self continueWorldTourWithRemainingAnnotations:annotations]; } -- (void)continueWorldTourWithRemainingAnnotations:(NS_MUTABLE_ARRAY_OF(MGLPointAnnotation *) *)annotations +- (void)continueWorldTourWithRemainingAnnotations:(NSMutableArray *)annotations { MGLPointAnnotation *nextAnnotation = annotations.firstObject; if (!nextAnnotation || !_isTouringWorld) diff --git a/platform/ios/benchmark/MBXBenchViewController.mm b/platform/ios/benchmark/MBXBenchViewController.mm index d4629e2521..84c2790d50 100644 --- a/platform/ios/benchmark/MBXBenchViewController.mm +++ b/platform/ios/benchmark/MBXBenchViewController.mm @@ -76,10 +76,8 @@ [self startBenchmarkIteration]; }]; [alertController addAction:OKAction]; + alertController.preferredAction = OKAction; - if ([alertController respondsToSelector:@selector(setPreferredAction:)]) { - alertController.preferredAction = OKAction; - } [self presentViewController:alertController animated:YES completion:nil]; } } diff --git a/platform/ios/docs/doc-README.md b/platform/ios/docs/doc-README.md index 7cd0376d07..3a95aa96de 100644 --- a/platform/ios/docs/doc-README.md +++ b/platform/ios/docs/doc-README.md @@ -1,6 +1,6 @@ # [Mapbox Maps SDK for iOS](https://www.mapbox.com/ios-sdk/) -The Mapbox Maps SDK for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 8.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL. +The Mapbox Maps SDK for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL. ![Mapbox Maps SDK for iOS screenshots](img/screenshot.png) diff --git a/platform/ios/docs/pod-README.md b/platform/ios/docs/pod-README.md index f94073bd9f..8a3080055d 100644 --- a/platform/ios/docs/pod-README.md +++ b/platform/ios/docs/pod-README.md @@ -1,6 +1,6 @@ # [Mapbox Maps SDK for iOS](https://www.mapbox.com/ios-sdk/) -The Mapbox Maps SDK for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 8.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL. +The Mapbox Maps SDK for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the [Mapbox Style Specification](https://www.mapbox.com/mapbox-gl-style-spec/), applies them to vector tiles that conform to the [Mapbox Vector Tile Specification](https://www.mapbox.com/developers/vector-tiles/), and renders them using OpenGL. For more information, check out the [Mapbox Maps SDK for iOS homepage](https://www.mapbox.com/ios-sdk/) and the [full changelog](https://github.com/mapbox/mapbox-gl-native/blob/master/platform/ios/CHANGELOG.md) online. @@ -10,7 +10,7 @@ For more information, check out the [Mapbox Maps SDK for iOS homepage](https://w The Mapbox Maps SDK for iOS may be installed as either a dynamic framework or a static framework. (To reduce the download size, the static framework is omitted from some distributions; you may need to download the full package from the [release page](https://github.com/mapbox/mapbox-gl-native/releases/).) -Integrating the Mapbox Maps SDK for iOS requires Xcode 8.0 or higher. To use this SDK with Xcode 7.3.1, download and use a symbols build from the [releases](https://github.com/mapbox/mapbox-gl-native/releases) page. +Integrating the Mapbox Maps SDK for iOS requires Xcode 8.0 or higher. {{DYNAMIC}} diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index a9413accf2..cb5a5587a2 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -3371,7 +3371,6 @@ CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Tests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3397,7 +3396,6 @@ CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Tests/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3423,7 +3421,6 @@ CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Test Harness/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harness"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3448,7 +3445,6 @@ CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; INFOPLIST_FILE = "Integration Test Harness/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.Integration-Test-Harness"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -3506,7 +3502,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -3559,7 +3555,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -3575,7 +3571,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL; PRODUCT_NAME = "Mapbox GL"; @@ -3589,7 +3584,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL; PRODUCT_NAME = "Mapbox GL"; @@ -3624,7 +3618,6 @@ CLANG_ENABLE_MODULES = YES; HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = test/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_CPLUSPLUSFLAGS = ( @@ -3649,7 +3642,6 @@ CLANG_ENABLE_MODULES = YES; HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = test/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_CPLUSPLUSFLAGS = ( @@ -3684,7 +3676,6 @@ ); INFOPLIST_FILE = framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_CPLUSPLUSFLAGS = ( @@ -3727,7 +3718,6 @@ ); INFOPLIST_FILE = framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_CFLAGS = "-fvisibility=hidden"; OTHER_CPLUSPLUSFLAGS = ( @@ -3841,7 +3831,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/benchmark/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.bench; PRODUCT_NAME = "Bench GL"; @@ -3853,7 +3842,6 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "$(SRCROOT)/benchmark/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.bench; PRODUCT_NAME = "Bench GL"; diff --git a/platform/ios/src/MGLAnnotationContainerView.h b/platform/ios/src/MGLAnnotationContainerView.h index 90d2964831..ccec3052a6 100644 --- a/platform/ios/src/MGLAnnotationContainerView.h +++ b/platform/ios/src/MGLAnnotationContainerView.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)annotationContainerViewWithAnnotationContainerView:(MGLAnnotationContainerView *)annotationContainerView; -- (void)addSubviews:(NS_ARRAY_OF(MGLAnnotationView *) *)subviews; +- (void)addSubviews:(NSArray *)subviews; @end diff --git a/platform/ios/src/MGLAnnotationContainerView.m b/platform/ios/src/MGLAnnotationContainerView.m index 9a823c839c..6c82a1836d 100644 --- a/platform/ios/src/MGLAnnotationContainerView.m +++ b/platform/ios/src/MGLAnnotationContainerView.m @@ -3,7 +3,7 @@ @interface MGLAnnotationContainerView () -@property (nonatomic) NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *annotationViews; +@property (nonatomic) NSMutableArray *annotationViews; @end @@ -26,7 +26,7 @@ return newAnnotationContainerView; } -- (void)addSubviews:(NS_ARRAY_OF(MGLAnnotationView *) *)subviews +- (void)addSubviews:(NSArray *)subviews { for (MGLAnnotationView *view in subviews) { diff --git a/platform/ios/src/MGLAnnotationContainerView_Private.h b/platform/ios/src/MGLAnnotationContainerView_Private.h index 007b03550b..9dce54842d 100644 --- a/platform/ios/src/MGLAnnotationContainerView_Private.h +++ b/platform/ios/src/MGLAnnotationContainerView_Private.h @@ -7,7 +7,7 @@ NS_ASSUME_NONNULL_BEGIN @interface MGLAnnotationContainerView (Private) -@property (nonatomic) NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *annotationViews; +@property (nonatomic) NSMutableArray *annotationViews; @end diff --git a/platform/ios/src/MGLMapAccessibilityElement.mm b/platform/ios/src/MGLMapAccessibilityElement.mm index 8bce38a145..c1cc5304d7 100644 --- a/platform/ios/src/MGLMapAccessibilityElement.mm +++ b/platform/ios/src/MGLMapAccessibilityElement.mm @@ -56,10 +56,8 @@ // may be in the local language, which may be written in another script. // Attempt to transform to the script of the preferred language, keeping // the original string if no transform exists or if transformation fails. - if (@available(iOS 9.0, *)) { - NSString *dominantScript = [NSOrthography mgl_dominantScriptForMapboxStreetsLanguage:languageCode]; - name = [name mgl_stringByTransliteratingIntoScript:dominantScript]; - } + NSString *dominantScript = [NSOrthography mgl_dominantScriptForMapboxStreetsLanguage:languageCode]; + name = [name mgl_stringByTransliteratingIntoScript:dominantScript]; self.accessibilityLabel = name; } diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 765f0f932b..bde8e6a71d 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -189,7 +189,7 @@ MGL_EXPORT IB_DESIGNABLE */ @property (nonatomic, readonly, nullable) MGLStyle *style; -@property (nonatomic, readonly) NS_ARRAY_OF(NSURL *) *bundledStyleURLs __attribute__((unavailable("Call the relevant class method of MGLStyle for the URL of a particular default style."))); +@property (nonatomic, readonly) NSArray *bundledStyleURLs __attribute__((unavailable("Call the relevant class method of MGLStyle for the URL of a particular default style."))); /** URL of the style currently displayed in the receiver. @@ -286,7 +286,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (IBAction)showAttribution:(id)sender; -@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((unavailable("Support for style classes has been removed."))); +@property (nonatomic) NSArray *styleClasses __attribute__((unavailable("Support for style classes has been removed."))); - (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((unavailable("Support for style classes has been removed."))); @@ -773,7 +773,7 @@ MGL_EXPORT IB_DESIGNABLE @param animated `YES` if you want the map region change to be animated, or `NO` if you want the map to display the new region immediately without animations. */ -- (void)showAnnotations:(NS_ARRAY_OF(id ) *)annotations animated:(BOOL)animated; +- (void)showAnnotations:(NSArray> *)annotations animated:(BOOL)animated; /** Sets the visible region so that the map displays the specified annotations with @@ -788,7 +788,7 @@ MGL_EXPORT IB_DESIGNABLE @param animated `YES` if you want the map region change to be animated, or `NO` if you want the map to display the new region immediately without animations. */ -- (void)showAnnotations:(NS_ARRAY_OF(id ) *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated; +- (void)showAnnotations:(NSArray> *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated; /** A camera representing the current viewpoint of the map. @@ -1076,7 +1076,7 @@ MGL_EXPORT IB_DESIGNABLE annotations are associated with the map view, the value of this property is `nil`. */ -@property (nonatomic, readonly, nullable) NS_ARRAY_OF(id ) *annotations; +@property (nonatomic, readonly, nullable) NSArray> *annotations; /** Adds an annotation to the map view. @@ -1104,7 +1104,7 @@ MGL_EXPORT IB_DESIGNABLE must conform to the `MGLAnnotation` protocol. The map view retains each individual annotation object. */ -- (void)addAnnotations:(NS_ARRAY_OF(id ) *)annotations; +- (void)addAnnotations:(NSArray> *)annotations; /** Removes an annotation from the map view, deselecting it if it is selected. @@ -1129,7 +1129,7 @@ MGL_EXPORT IB_DESIGNABLE @param annotations The array of annotation objects to remove. Objects in the array must conform to the `MGLAnnotation` protocol. */ -- (void)removeAnnotations:(NS_ARRAY_OF(id ) *)annotations; +- (void)removeAnnotations:(NSArray> *)annotations; /** Returns an `MGLAnnotationView` if the given annotation is currently associated @@ -1180,7 +1180,7 @@ MGL_EXPORT IB_DESIGNABLE annotations are associated with the map view or if no annotations associated with the map view are currently visible, the value of this property is `nil`. */ -@property (nonatomic, readonly, nullable) NS_ARRAY_OF(id ) *visibleAnnotations; +@property (nonatomic, readonly, nullable) NSArray> *visibleAnnotations; /** Returns the list of annotations associated with the receiver that intersect with @@ -1191,7 +1191,7 @@ MGL_EXPORT IB_DESIGNABLE no annotations associated with the map view are currently visible in the rectangle. */ -- (nullable NS_ARRAY_OF(id ) *)visibleAnnotationsInRect:(CGRect)rect; +- (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect; #pragma mark Managing Annotation Selections @@ -1208,7 +1208,7 @@ MGL_EXPORT IB_DESIGNABLE @note In versions prior to `4.0.0` if the annotation was offscreen it was not selected. */ -@property (nonatomic, copy) NS_ARRAY_OF(id ) *selectedAnnotations; +@property (nonatomic, copy) NSArray> *selectedAnnotations; /** Selects an annotation and displays its callout view. @@ -1246,7 +1246,7 @@ MGL_EXPORT IB_DESIGNABLE overlays are associated with the map view, the value of this property is empty array. */ -@property (nonatomic, readonly, nonnull) NS_ARRAY_OF(id ) *overlays; +@property (nonatomic, readonly, nonnull) NSArray> *overlays; /** Adds a single overlay object to the map. @@ -1265,7 +1265,7 @@ MGL_EXPORT IB_DESIGNABLE @param overlays An array of objects, each of which must conform to the `MGLOverlay` protocol. */ -- (void)addOverlays:(NS_ARRAY_OF(id ) *)overlays; +- (void)addOverlays:(NSArray> *)overlays; /** Removes a single overlay object from the map. @@ -1285,7 +1285,7 @@ MGL_EXPORT IB_DESIGNABLE @param overlays An array of objects, each of which conforms to the `MGLOverlay` protocol. */ -- (void)removeOverlays:(NS_ARRAY_OF(id ) *)overlays; +- (void)removeOverlays:(NSArray> *)overlays; #pragma mark Accessing the Underlying Map Data @@ -1301,7 +1301,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(CGPoint)point NS_SWIFT_NAME(visibleFeatures(at:)); +- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point NS_SWIFT_NAME(visibleFeatures(at:)); /** Returns an array of rendered map features that intersect with a given point, @@ -1320,7 +1320,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NS_SET_OF(NSString *) *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:)); +- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:)); /** Returns an array of rendered map features that intersect with a given point, @@ -1387,7 +1387,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:predicate:)); +- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:predicate:)); /** Returns an array of rendered map features that intersect with the given @@ -1402,7 +1402,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(CGRect)rect NS_SWIFT_NAME(visibleFeatures(in:)); +- (NSArray> *)visibleFeaturesInRect:(CGRect)rect NS_SWIFT_NAME(visibleFeatures(in:)); /** Returns an array of rendered map features that intersect with the given @@ -1421,7 +1421,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NS_SET_OF(NSString *) *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:)); +- (NSArray> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:)); /** Returns an array of rendered map features that intersect with the given @@ -1493,7 +1493,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:)); +- (NSArray> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:)); #pragma mark Debugging the Map diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index b7d0974872..978547b9c6 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -194,14 +194,14 @@ public: @property (nonatomic) GLKView *glView; @property (nonatomic) UIImageView *glSnapshotView; -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *scaleBarConstraints; +@property (nonatomic) NSMutableArray *scaleBarConstraints; @property (nonatomic, readwrite) MGLScaleBar *scaleBar; @property (nonatomic, readwrite) UIImageView *compassView; -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *compassViewConstraints; +@property (nonatomic) NSMutableArray *compassViewConstraints; @property (nonatomic, readwrite) UIImageView *logoView; -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *logoViewConstraints; +@property (nonatomic) NSMutableArray *logoViewConstraints; @property (nonatomic, readwrite) UIButton *attributionButton; -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *attributionButtonConstraints; +@property (nonatomic) NSMutableArray *attributionButtonConstraints; @property (nonatomic, readwrite) MGLStyle *style; @@ -217,7 +217,7 @@ public: @property (nonatomic) MGLCameraChangeReason cameraChangeReasonBitmask; /// Mapping from reusable identifiers to annotation images. -@property (nonatomic) NS_MUTABLE_DICTIONARY_OF(NSString *, MGLAnnotationImage *) *annotationImagesByIdentifier; +@property (nonatomic) NSMutableDictionary *annotationImagesByIdentifier; /// Currently shown popover representing the selected annotation. @property (nonatomic) UIView *calloutViewForSelectedAnnotation; @@ -235,7 +235,7 @@ public: @property (nonatomic) MGLMapViewProxyAccessibilityElement *mapViewProxyAccessibilityElement; @property (nonatomic) MGLAnnotationContainerView *annotationContainerView; @property (nonatomic) MGLUserLocation *userLocation; -@property (nonatomic) NS_MUTABLE_DICTIONARY_OF(NSString *, NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *) *annotationViewReuseQueueByIdentifier; +@property (nonatomic) NSMutableDictionary *> *annotationViewReuseQueueByIdentifier; @end @@ -287,9 +287,9 @@ public: BOOL _delegateHasLineWidthsForShapeAnnotations; MGLCompassDirectionFormatter *_accessibilityCompassFormatter; - NS_ARRAY_OF(id ) *_visiblePlaceFeatures; - NS_ARRAY_OF(id ) *_visibleRoadFeatures; - NS_MUTABLE_SET_OF(MGLFeatureAccessibilityElement *) *_featureAccessibilityElements; + NSArray> *_visiblePlaceFeatures; + NSArray> *_visibleRoadFeatures; + NSMutableSet *_featureAccessibilityElements; BOOL _accessibilityValueAnnouncementIsPending; MGLReachability *_reachability; @@ -335,12 +335,12 @@ public: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyle ++ (NSSet *)keyPathsForValuesAffectingStyle { return [NSSet setWithObject:@"styleURL"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyleURL ++ (NSSet *)keyPathsForValuesAffectingStyleURL { return [NSSet setWithObjects:@"styleURL__", nil]; } @@ -624,18 +624,8 @@ public: UIGraphicsBeginImageContextWithOptions(scaleImage.size, NO, [UIScreen mainScreen].scale); [scaleImage drawInRect:{ CGPointZero, scaleImage.size }]; - CGFloat northSize = 11; - UIFont *northFont; - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - northFont = [UIFont systemFontOfSize:northSize weight:UIFontWeightUltraLight]; - } - else - { - northFont = [UIFont systemFontOfSize:northSize]; - } NSAttributedString *north = [[NSAttributedString alloc] initWithString:NSLocalizedStringWithDefaultValue(@"COMPASS_NORTH", nil, nil, @"N", @"Compass abbreviation for north") attributes:@{ - NSFontAttributeName: northFont, + NSFontAttributeName: [UIFont systemFontOfSize:11 weight:UIFontWeightUltraLight], NSForegroundColorAttributeName: [UIColor whiteColor], }]; CGRect stringRect = CGRectMake((scaleImage.size.width - north.size.width) / 2, @@ -1273,7 +1263,7 @@ public: } } -- (void)touchesBegan:(__unused NS_SET_OF(UITouch *) *)touches withEvent:(__unused UIEvent *)event +- (void)touchesBegan:(__unused NSSet *)touches withEvent:(__unused UIEvent *)event { _changeDelimiterSuppressionDepth = 0; _mbglMap->setGestureInProgress(false); @@ -2238,22 +2228,22 @@ public: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingZoomEnabled ++ (NSSet *)keyPathsForValuesAffectingZoomEnabled { return [NSSet setWithObject:@"allowsZooming"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingScrollEnabled ++ (NSSet *)keyPathsForValuesAffectingScrollEnabled { return [NSSet setWithObject:@"allowsScrolling"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingRotateEnabled ++ (NSSet *)keyPathsForValuesAffectingRotateEnabled { return [NSSet setWithObject:@"allowsRotating"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingPitchEnabled ++ (NSSet *)keyPathsForValuesAffectingPitchEnabled { return [NSSet setWithObject:@"allowsTilting"]; } @@ -2419,7 +2409,7 @@ public: return value; } -- (NS_ARRAY_OF(id ) *)visiblePlaceFeatures +- (NSArray> *)visiblePlaceFeatures { if (!_visiblePlaceFeatures) { @@ -2429,7 +2419,7 @@ public: return _visiblePlaceFeatures; } -- (NS_ARRAY_OF(id ) *)visibleRoadFeatures +- (NSArray> *)visibleRoadFeatures { if (!_visibleRoadFeatures) { @@ -2907,7 +2897,7 @@ public: #pragma mark - Geography - -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingCenterCoordinate ++ (NSSet *)keyPathsForValuesAffectingCenterCoordinate { return [NSSet setWithObjects:@"latitude", @"longitude", @"camera", nil]; } @@ -2998,7 +2988,7 @@ public: _mbglMap->easeTo(cameraOptions, animationOptions); } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingZoomLevel ++ (NSSet *)keyPathsForValuesAffectingZoomLevel { return [NSSet setWithObject:@"camera"]; } @@ -3167,7 +3157,7 @@ public: [self didChangeValueForKey:@"visibleCoordinateBounds"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingDirection ++ (NSSet *)keyPathsForValuesAffectingDirection { return [NSSet setWithObject:@"camera"]; } @@ -3217,12 +3207,12 @@ public: [self setDirection:direction animated:NO]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingPitch ++ (NSSet *)keyPathsForValuesAffectingPitch { return [NSSet setWithObject:@"camera"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingCamera ++ (NSSet *)keyPathsForValuesAffectingCamera { return [NSSet setWithObjects:@"longitude", @"latitude", @"centerCoordinate", @"zoomLevel", @"direction", nil]; } @@ -3496,7 +3486,7 @@ public: #pragma mark - Annotations - -- (nullable NS_ARRAY_OF(id ) *)annotations +- (nullable NSArray> *)annotations { if (_annotationContextsByAnnotationTag.empty()) { @@ -3520,12 +3510,12 @@ public: return [NSArray arrayWithObjects:&annotations[0] count:annotations.size()]; } -- (nullable NS_ARRAY_OF(id ) *)visibleAnnotations +- (nullable NSArray> *)visibleAnnotations { return [self visibleAnnotationsInRect:self.bounds]; } -- (nullable NS_ARRAY_OF(id ) *)visibleAnnotationsInRect:(CGRect)rect +- (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect { if (_annotationContextsByAnnotationTag.empty()) { @@ -3599,7 +3589,7 @@ public: [self addAnnotations:@[ annotation ]]; } -- (void)addAnnotations:(NS_ARRAY_OF(id ) *)annotations +- (void)addAnnotations:(NSArray> *)annotations { if ( ! annotations) return; [self willChangeValueForKey:@"annotations"]; @@ -3740,7 +3730,7 @@ public: UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil); } -- (void)updateAnnotationContainerViewWithAnnotationViews:(NS_ARRAY_OF(MGLAnnotationView *) *)annotationViews +- (void)updateAnnotationContainerViewWithAnnotationViews:(NSArray *)annotationViews { if (annotationViews.count == 0) return; @@ -3895,7 +3885,7 @@ public: [self removeAnnotations:@[ annotation ]]; } -- (void)removeAnnotations:(NS_ARRAY_OF(id ) *)annotations +- (void)removeAnnotations:(NSArray> *)annotations { if ( ! annotations) return; @@ -3956,11 +3946,11 @@ public: } } -- (nonnull NS_ARRAY_OF(id ) *)overlays +- (nonnull NSArray> *)overlays { if (self.annotations == nil) { return @[]; } - NS_MUTABLE_ARRAY_OF(id ) *mutableOverlays = [NSMutableArray array]; + NSMutableArray> *mutableOverlays = [NSMutableArray array]; [self.annotations enumerateObjectsUsingBlock:^(id _Nonnull annotation, NSUInteger idx, BOOL * _Nonnull stop) { if ([annotation conformsToProtocol:@protocol(MGLOverlay)]) @@ -3977,7 +3967,7 @@ public: [self addOverlays:@[ overlay ]]; } -- (void)addOverlays:(NS_ARRAY_OF(id ) *)overlays +- (void)addOverlays:(NSArray> *)overlays { #if DEBUG for (id overlay in overlays) @@ -3994,7 +3984,7 @@ public: [self removeOverlays:@[ overlay ]]; } -- (void)removeOverlays:(NS_ARRAY_OF(id ) *)overlays +- (void)removeOverlays:(NSArray> *)overlays { #if DEBUG for (id overlay in overlays) @@ -4226,13 +4216,13 @@ public: [self didChangeValueForKey:@"selectedAnnotations"]; } -- (NS_ARRAY_OF(id ) *)selectedAnnotations +- (NSArray> *)selectedAnnotations { id selectedAnnotation = self.selectedAnnotation; return (selectedAnnotation ? @[ selectedAnnotation ] : @[]); } -- (void)setSelectedAnnotations:(NS_ARRAY_OF(id ) *)selectedAnnotations +- (void)setSelectedAnnotations:(NSArray> *)selectedAnnotations { if ( ! selectedAnnotations.count) return; @@ -4578,7 +4568,7 @@ public: completion:NULL]; } -- (void)showAnnotations:(NS_ARRAY_OF(id ) *)annotations animated:(BOOL)animated +- (void)showAnnotations:(NSArray> *)annotations animated:(BOOL)animated { CGFloat maximumPadding = 100; CGFloat yPadding = (self.frame.size.height / 5 <= maximumPadding) ? (self.frame.size.height / 5) : maximumPadding; @@ -4589,7 +4579,7 @@ public: [self showAnnotations:annotations edgePadding:edgeInsets animated:animated]; } -- (void)showAnnotations:(NS_ARRAY_OF(id ) *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated +- (void)showAnnotations:(NSArray> *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated { if ( ! annotations || ! annotations.count) return; @@ -4777,7 +4767,7 @@ public: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingUserLocation ++ (NSSet *)keyPathsForValuesAffectingUserLocation { return [NSSet setWithObject:@"userLocationAnnotationView"]; } @@ -5268,16 +5258,16 @@ public: #pragma mark Data -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(CGPoint)point +- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point { return [self visibleFeaturesAtPoint:point inStyleLayersWithIdentifiers:nil]; } -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers { +- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers { return [self visibleFeaturesAtPoint:point inStyleLayersWithIdentifiers:styleLayerIdentifiers predicate:nil]; } -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(NSPredicate *)predicate +- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { mbgl::ScreenCoordinate screenCoordinate = { point.x, point.y }; @@ -5302,15 +5292,15 @@ public: return MGLFeaturesFromMBGLFeatures(features); } -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(CGRect)rect { +- (NSArray> *)visibleFeaturesInRect:(CGRect)rect { return [self visibleFeaturesInRect:rect inStyleLayersWithIdentifiers:nil]; } -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers { +- (NSArray> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers { return [self visibleFeaturesInRect:rect inStyleLayersWithIdentifiers:styleLayerIdentifiers predicate:nil]; } -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { +- (NSArray> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { mbgl::ScreenBox screenBox = { { CGRectGetMinX(rect), CGRectGetMinY(rect) }, { CGRectGetMaxX(rect), CGRectGetMaxY(rect) }, @@ -6040,7 +6030,7 @@ public: views:views]]; } -- (NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *)annotationViewReuseQueueForIdentifier:(NSString *)identifier { +- (NSMutableArray *)annotationViewReuseQueueForIdentifier:(NSString *)identifier { if (!_annotationViewReuseQueueByIdentifier[identifier]) { _annotationViewReuseQueueByIdentifier[identifier] = [NSMutableArray array]; @@ -6197,7 +6187,7 @@ private: @implementation MGLMapView (IBAdditions) -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyleURL__ ++ (NSSet *)keyPathsForValuesAffectingStyleURL__ { return [NSSet setWithObject:@"styleURL"]; } @@ -6220,7 +6210,7 @@ private: self.styleURL = url; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingLatitude ++ (NSSet *)keyPathsForValuesAffectingLatitude { return [NSSet setWithObjects:@"centerCoordinate", @"camera", nil]; } @@ -6246,7 +6236,7 @@ private: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingLongitude ++ (NSSet *)keyPathsForValuesAffectingLongitude { return [NSSet setWithObjects:@"centerCoordinate", @"camera", nil]; } @@ -6272,7 +6262,7 @@ private: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsZooming ++ (NSSet *)keyPathsForValuesAffectingAllowsZooming { return [NSSet setWithObject:@"zoomEnabled"]; } @@ -6287,7 +6277,7 @@ private: self.zoomEnabled = allowsZooming; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsScrolling ++ (NSSet *)keyPathsForValuesAffectingAllowsScrolling { return [NSSet setWithObject:@"scrollEnabled"]; } @@ -6302,7 +6292,7 @@ private: self.scrollEnabled = allowsScrolling; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsRotating ++ (NSSet *)keyPathsForValuesAffectingAllowsRotating { return [NSSet setWithObject:@"rotateEnabled"]; } @@ -6317,7 +6307,7 @@ private: self.rotateEnabled = allowsRotating; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsTilting ++ (NSSet *)keyPathsForValuesAffectingAllowsTilting { return [NSSet setWithObject:@"pitchEnabled"]; } @@ -6332,7 +6322,7 @@ private: self.pitchEnabled = allowsTilting; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingShowsHeading ++ (NSSet *)keyPathsForValuesAffectingShowsHeading { return [NSSet setWithObject:@"showsUserHeadingIndicator"]; } diff --git a/platform/ios/src/MGLMapViewDelegate.h b/platform/ios/src/MGLMapViewDelegate.h index 0368d8413c..201e3db84b 100644 --- a/platform/ios/src/MGLMapViewDelegate.h +++ b/platform/ios/src/MGLMapViewDelegate.h @@ -428,7 +428,7 @@ NS_ASSUME_NONNULL_BEGIN @param annotationViews An array of `MGLAnnotationView` objects representing the views that were added. */ -- (void)mapView:(MGLMapView *)mapView didAddAnnotationViews:(NS_ARRAY_OF(MGLAnnotationView *) *)annotationViews; +- (void)mapView:(MGLMapView *)mapView didAddAnnotationViews:(NSArray *)annotationViews; #pragma mark Selecting Annotations diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm index 139dffdfab..a2fc24c75c 100644 --- a/platform/ios/src/MGLScaleBar.mm +++ b/platform/ios/src/MGLScaleBar.mm @@ -178,12 +178,7 @@ static const CGFloat MGLFeetPerMeter = 3.28084; #pragma mark - Convenience methods - (BOOL)usesRightToLeftLayout { - // semanticContentAttribute is iOS 9+ - if ([self.superview respondsToSelector:@selector(semanticContentAttribute)]) { - return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.superview.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft; - } else { - return UIApplication.sharedApplication.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft; - } + return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.superview.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft; } - (BOOL)usesMetricSystem { diff --git a/platform/ios/src/MGLUserLocation.m b/platform/ios/src/MGLUserLocation.m index 074d138a72..245cbf4371 100644 --- a/platform/ios/src/MGLUserLocation.m +++ b/platform/ios/src/MGLUserLocation.m @@ -68,7 +68,7 @@ NS_ASSUME_NONNULL_END return ! [key isEqualToString:@"location"] && ! [key isEqualToString:@"heading"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingCoordinate ++ (NSSet *)keyPathsForValuesAffectingCoordinate { return [NSSet setWithObject:@"location"]; } diff --git a/platform/ios/test/MGLMapAccessibilityElementTests.m b/platform/ios/test/MGLMapAccessibilityElementTests.m index 89a595421e..916461e708 100644 --- a/platform/ios/test/MGLMapAccessibilityElementTests.m +++ b/platform/ios/test/MGLMapAccessibilityElementTests.m @@ -25,11 +25,7 @@ @"name_en": @"Цинциннати", }; element = [[MGLFeatureAccessibilityElement alloc] initWithAccessibilityContainer:self feature:feature]; - if (@available(iOS 9.0, *)) { - XCTAssertEqualObjects(element.accessibilityLabel, @"Cincinnati", @"Accessibility label should be romanized."); - } else { - XCTAssertEqualObjects(element.accessibilityLabel, @"Цинциннати", @"Accessibility label should not be romanized."); - } + XCTAssertEqualObjects(element.accessibilityLabel, @"Cincinnati", @"Accessibility label should be romanized."); } - (void)testPlaceFeatureValues { -- cgit v1.2.1 From 4f7999fd1cec34e9beaf130d30897548d8dbca4a Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Tue, 24 Apr 2018 19:21:50 -0400 Subject: [ios, macos] Accept Xcode 9.3 project suggestions - Fix duplicate NSExpression+MGLAdditions.h and fix target membership - Explicitly cast NSUInteger to unsigned long before printing --- platform/ios/ios.xcodeproj/project.pbxproj | 16 +++++++--------- .../ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme | 2 +- .../xcschemes/Integration Test Harness.xcscheme | 4 +--- .../ios.xcodeproj/xcshareddata/xcschemes/bench.xcscheme | 4 +--- .../xcshareddata/xcschemes/dynamic+static.xcscheme | 4 +--- .../xcshareddata/xcschemes/dynamic.xcscheme | 4 +--- .../ios.xcodeproj/xcshareddata/xcschemes/iosapp.xcscheme | 4 +--- .../ios.xcodeproj/xcshareddata/xcschemes/static.xcscheme | 4 +--- .../xcshareddata/xcschemes/Mapbox GL Tests.xcscheme | 4 +--- 9 files changed, 15 insertions(+), 31 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 6892760f59..80335b8bf0 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -53,7 +53,6 @@ 3510FFEC1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3510FFE91D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm */; }; 3510FFED1D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3510FFE91D6D9C7A00F413B2 /* NSComparisonPredicate+MGLAdditions.mm */; }; 3510FFF01D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFEE1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3510FFF11D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFEE1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3510FFF21D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3510FFEF1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm */; }; 3510FFF31D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3510FFEF1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm */; }; 3510FFF91D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFF71D6DCC4700F413B2 /* NSCompoundPredicate+MGLAdditions.h */; }; @@ -307,6 +306,7 @@ 9620BB391E69FE1700705A1D /* MGLSDKUpdateChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 9620BB361E69FE1700705A1D /* MGLSDKUpdateChecker.h */; }; 9620BB3A1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */; }; 9620BB3B1E69FE1700705A1D /* MGLSDKUpdateChecker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9620BB371E69FE1700705A1D /* MGLSDKUpdateChecker.mm */; }; + 9621F2502091020E005B3800 /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 3510FFEE1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9654C1261FFC1AB900DB6A19 /* MGLPolyline_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C1251FFC1AB900DB6A19 /* MGLPolyline_Private.h */; }; 9654C1291FFC1CCD00DB6A19 /* MGLPolygon_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 9654C1271FFC1CC000DB6A19 /* MGLPolygon_Private.h */; }; 9658C155204761FC00D8A674 /* MGLMapViewScaleBarTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9658C154204761FC00D8A674 /* MGLMapViewScaleBarTests.m */; }; @@ -511,8 +511,6 @@ DA8963381CC549A100684375 /* sprites in Resources */ = {isa = PBXBuildFile; fileRef = DA8963341CC549A100684375 /* sprites */; }; DA8963391CC549A100684375 /* styles in Resources */ = {isa = PBXBuildFile; fileRef = DA8963351CC549A100684375 /* styles */; }; DA89633A1CC549A100684375 /* tiles in Resources */ = {isa = PBXBuildFile; fileRef = DA8963361CC549A100684375 /* tiles */; }; - DA9EA82B201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA9EA82A201C0C0B00F9874D /* NSExpression+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - DA9EA82C201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = DA9EA82A201C0C0B00F9874D /* NSExpression+MGLAdditions.h */; }; DAA32CC31E4C6B65006F8D24 /* MGLDistanceFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = 3557F7AF1E1D27D300CCA5E6 /* MGLDistanceFormatter.m */; }; DAA4E4081CBB6C9500178DFB /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA8847D21CBAF91600AB86E3 /* Mapbox.framework */; }; DAA4E4091CBB6C9500178DFB /* Mapbox.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = DA8847D21CBAF91600AB86E3 /* Mapbox.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -1188,7 +1186,6 @@ DA9C012C1E4C7ADB00C4742A /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "pt-BR"; path = "pt-BR.lproj/Foundation.stringsdict"; sourceTree = ""; }; DA9C012D1E4C7B1F00C4742A /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; DA9C012E1E4C7B6100C4742A /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Root.strings"; sourceTree = ""; }; - DA9EA82A201C0C0B00F9874D /* NSExpression+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSExpression+MGLAdditions.h"; sourceTree = ""; }; DAA32CA11E4C44DB006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = de; path = de.lproj/Foundation.stringsdict; sourceTree = ""; }; DAA32CA21E4C44DD006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = de; path = de.lproj/Localizable.stringsdict; sourceTree = ""; }; DAA32CA31E4C44F1006F8D24 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Foundation.strings; sourceTree = ""; }; @@ -2099,7 +2096,6 @@ 408AA8561DAEDA0800022900 /* NSDictionary+MGLAdditions.mm */, DA8848141CBAFA6200AB86E3 /* NSException+MGLAdditions.h */, 3510FFEE1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h */, - DA9EA82A201C0C0B00F9874D /* NSExpression+MGLAdditions.h */, DAC25FCB200FD83E009BE98E /* NSExpression+MGLPrivateAdditions.h */, 3510FFEF1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm */, 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */, @@ -2289,7 +2285,6 @@ DA8848841CBB033F00AB86E3 /* FABAttributes.h in Headers */, DA8847FD1CBAFA5100AB86E3 /* MGLTilePyramidOfflineRegion.h in Headers */, DA88482F1CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h in Headers */, - DA9EA82B201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */, DA8848601CBAFC2E00AB86E3 /* Mapbox.h in Headers */, DAF0D8101DFE0EA000B28378 /* MGLRasterTileSource_Private.h in Headers */, 350098BB1D480108004B2AF0 /* MGLVectorTileSource.h in Headers */, @@ -2319,7 +2314,6 @@ DABFB8641CBE99E500D62B32 /* MGLOfflineStorage.h in Headers */, 96E516E32000552A00A02306 /* MGLAccountManager_Private.h in Headers */, 96E5170420005A6B00A02306 /* SMCalloutView.h in Headers */, - DA9EA82C201C0C0C00F9874D /* NSExpression+MGLAdditions.h in Headers */, 96036A02200565C700510F3D /* NSOrthography+MGLAdditions.h in Headers */, DAD165791CF4CDFF001FF4B9 /* MGLShapeCollection.h in Headers */, 4049C29E1DB6CD6C00B3F799 /* MGLPointCollection.h in Headers */, @@ -2329,7 +2323,6 @@ 96E516F6200059EC00A02306 /* MGLRendererFrontend.h in Headers */, 071BBB041EE76147001FB02A /* MGLImageSource.h in Headers */, DABFB8611CBE99E500D62B32 /* MGLMultiPoint.h in Headers */, - 3510FFF11D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */, 35D3A1E71E9BE7EC002B38EE /* MGLScaleBar.h in Headers */, 96E516EF2000594F00A02306 /* NSArray+MGLAdditions.h in Headers */, 96E516F12000596800A02306 /* NSString+MGLAdditions.h in Headers */, @@ -2434,6 +2427,7 @@ 96E516E12000551100A02306 /* MGLMultiPoint_Private.h in Headers */, 3EA934623AD0000B7D99C3FB /* MGLRendererConfiguration.h in Headers */, DACA86272019218600E9693A /* MGLRasterDEMSource.h in Headers */, + 9621F2502091020E005B3800 /* NSExpression+MGLAdditions.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2609,7 +2603,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = MBX; - LastUpgradeCheck = 0910; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = Mapbox; TargetAttributes = { 16376B061FFD9DAF0000563E = { @@ -3474,6 +3468,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -3481,6 +3476,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -3533,6 +3529,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -3540,6 +3537,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme b/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme index afba168676..01b565d5d9 100644 --- a/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme +++ b/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/CI.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Release" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/dynamic+static.xcscheme b/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/dynamic+static.xcscheme index e5f17124f2..325b58d690 100644 --- a/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/dynamic+static.xcscheme +++ b/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/dynamic+static.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/static.xcscheme b/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/static.xcscheme index fc385d3763..f88ec1a04c 100644 --- a/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/static.xcscheme +++ b/platform/ios/ios.xcodeproj/xcshareddata/xcschemes/static.xcscheme @@ -1,6 +1,6 @@ @@ -46,7 +45,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/platform/ios/uitest/ios-tests.xcodeproj/xcshareddata/xcschemes/Mapbox GL Tests.xcscheme b/platform/ios/uitest/ios-tests.xcodeproj/xcshareddata/xcschemes/Mapbox GL Tests.xcscheme index b1a1db6ba1..2c8de87a0f 100644 --- a/platform/ios/uitest/ios-tests.xcodeproj/xcshareddata/xcschemes/Mapbox GL Tests.xcscheme +++ b/platform/ios/uitest/ios-tests.xcodeproj/xcshareddata/xcschemes/Mapbox GL Tests.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 24 Apr 2018 20:32:43 -0400 Subject: [ios, macos] Fix possible retain cycles in blocks Prompted by enabling CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF. --- platform/ios/src/MGLMapView.mm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index c679979d37..34269ce442 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -4570,6 +4570,8 @@ public: return; } + __weak __typeof__(self) weakSelf = self; + // The user location callout view initially points to the user location // annotation’s implicit (visual) frame, which is offset from the // annotation’s explicit frame. Now the callout view needs to rendezvous @@ -4583,10 +4585,16 @@ public: UIViewAnimationOptionBeginFromCurrentState) animations:^ { + __typeof__(self) strongSelf = weakSelf; + if ( ! strongSelf) + { + return; + } + calloutView.frame = CGRectOffset(calloutView.frame, - _initialImplicitCalloutViewOffset.x, - _initialImplicitCalloutViewOffset.y); - _initialImplicitCalloutViewOffset = CGPointZero; + strongSelf->_initialImplicitCalloutViewOffset.x, + strongSelf->_initialImplicitCalloutViewOffset.y); + strongSelf->_initialImplicitCalloutViewOffset = CGPointZero; } completion:NULL]; } -- cgit v1.2.1 From 9a4b806fa84bd3d2d1adb57eae4f9fdb5f79d9f9 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Sun, 29 Apr 2018 15:27:49 -0700 Subject: [docs] Make per-platform installation docs self-contained I've seen several issues where users followed platform-specific install docs, but were unaware of additional prerequisites spelled out in the top-level INSTALL.md. So let's try making each platform's installation documentation self contained. --- platform/ios/DEVELOPING.md | 6 +----- platform/ios/INSTALL.md | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 9 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/DEVELOPING.md b/platform/ios/DEVELOPING.md index b407e78e4b..34388c2589 100644 --- a/platform/ios/DEVELOPING.md +++ b/platform/ios/DEVELOPING.md @@ -4,14 +4,10 @@ This document explains how to build the Mapbox Maps SDK for iOS from source. It ## Requirements -The Mapbox Maps SDK for iOS and iosapp demo application require iOS 9.0 or above. - -The Mapbox Maps SDK for iOS requires Xcode 9.1 or above to compile from source. +See the "Requirements" section in [INSTALL.md](INSTALL.md). ## Building the SDK -Make sure that you have the [core dependencies](../../INSTALL.md) installed. - Create and open an Xcode workspace that includes both the SDK source and some Objective-C test applications by running: ```bash diff --git a/platform/ios/INSTALL.md b/platform/ios/INSTALL.md index f253d3019d..3c79e4dcf8 100644 --- a/platform/ios/INSTALL.md +++ b/platform/ios/INSTALL.md @@ -18,16 +18,34 @@ The Mapbox Maps SDK for iOS requires: * Xcode 9.1 or higher to compile from source * Xcode 8.0 or higher to integrate the compiled framework into an application -### Building the SDK - -1. [Install core dependencies](../../INSTALL.md). +Before building, follow these steps to install prerequisites: +1. Install [Xcode](https://developer.apple.com/xcode/) +1. Launch Xcode and install any updates +1. Install [Homebrew](http://brew.sh) +1. Install [Node.js](https://nodejs.org/), [CMake](https://cmake.org/), and [ccache](https://ccache.samba.org): + ``` + brew install node cmake ccache + ``` +1. Install [xcpretty](https://github.com/supermarin/xcpretty) (optional, used for prettifying command line builds): + ``` + [sudo] gem install xcpretty + ``` 1. Install [jazzy](https://github.com/realm/jazzy) for generating API documentation: - ``` [sudo] gem install jazzy ``` +### Building the SDK + +1. Clone the git repository: + ``` + git clone https://github.com/mapbox/mapbox-gl-native.git + cd mapbox-gl-native + ``` + Note that this repository uses Git submodules. They'll be automatically checked out when you first run a `make` command, + but are not updated automatically. We recommended that you run `git submodule update` after pulling down new commits to + this repository. 1. Run `make iframework BUILDTYPE=Release`. The packaging script will produce a `build/ios/pkg/` folder containing: - a `dynamic` folder containing a dynamically-linked fat framework with debug symbols for devices and the iOS Simulator - a `documentation` folder with HTML API documentation -- cgit v1.2.1 From a96fe6ad87d386f25a57a2a7a6632382951733f0 Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Tue, 1 May 2018 13:05:51 -0700 Subject: [core] Don't copy TileLayerIndexes on every frame. Fixes issue #11811 (too much CPU time spent in CrossTileSymbolIndex). --- platform/ios/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index c6b744395b..3ec701c8ed 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -12,6 +12,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) * Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) +* Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) ## 4.0.0 - April 19, 2018 -- cgit v1.2.1 From ea59ba8209604c91b76abb31e6be15932bcb3430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 27 Apr 2018 12:07:28 -0700 Subject: [android, ios, macos] Added Korean localization --- platform/ios/CHANGELOG.md | 3 +- platform/ios/app/ko.lproj/Localizable.strings | 0 .../Settings.bundle/ko.lproj/Root.strings | 3 + platform/ios/ios.xcodeproj/project.pbxproj | 13 +++ .../ios/resources/ko.lproj/Localizable.strings | 117 +++++++++++++++++++++ .../ios/resources/ko.lproj/Localizable.stringsdict | 48 +++++++++ 6 files changed, 183 insertions(+), 1 deletion(-) create mode 100644 platform/ios/app/ko.lproj/Localizable.strings create mode 100644 platform/ios/framework/Settings.bundle/ko.lproj/Root.strings create mode 100644 platform/ios/resources/ko.lproj/Localizable.strings create mode 100644 platform/ios/resources/ko.lproj/Localizable.stringsdict (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 3ec701c8ed..ea7f819089 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -8,8 +8,9 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) -### Other +### Other changes +* Added a Korean localization. ([#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792)) * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) * Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) * Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) diff --git a/platform/ios/app/ko.lproj/Localizable.strings b/platform/ios/app/ko.lproj/Localizable.strings new file mode 100644 index 0000000000..e69de29bb2 diff --git a/platform/ios/framework/Settings.bundle/ko.lproj/Root.strings b/platform/ios/framework/Settings.bundle/ko.lproj/Root.strings new file mode 100644 index 0000000000..1fc9f9ce51 --- /dev/null +++ b/platform/ios/framework/Settings.bundle/ko.lproj/Root.strings @@ -0,0 +1,3 @@ +"TELEMETRY_GROUP_TITLE" = "개인 정보 설정"; +"TELEMETRY_SWITCH_TITLE" = "맵박스 텔레메트리"; +"TELEMETRY_GROUP_FOOTER" = "이 설정은 어플리케이션이 익명화된 장소와 사용데이터를 맵박스와 공유하는것을 허용합니다."; diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 80335b8bf0..f5d50522ef 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -1256,6 +1256,12 @@ DAFBD0D21E3FA7A1000CD6BF /* zh-Hant */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Foundation.strings"; sourceTree = ""; }; DAFBD0D31E3FA7A1000CD6BF /* zh-Hant */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; DAFBD0D41E3FA7A2000CD6BF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/Root.strings"; sourceTree = ""; }; + DAFEB3742093AE3700A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; + DAFEB3752093AE4800A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Foundation.strings; sourceTree = ""; }; + DAFEB3762093AE6800A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ko; path = ko.lproj/Foundation.stringsdict; sourceTree = ""; }; + DAFEB3772093AE7900A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Localizable.strings; sourceTree = ""; }; + DAFEB3782093AE9200A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = ko; path = ko.lproj/Localizable.stringsdict; sourceTree = ""; }; + DAFEB3792093AEA100A86A83 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Root.strings; sourceTree = ""; }; DD0902A21DB18DE700C5BDCE /* MGLNetworkConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGLNetworkConfiguration.m; sourceTree = ""; }; DD0902A41DB18F1B00C5BDCE /* MGLNetworkConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLNetworkConfiguration.h; sourceTree = ""; }; DD4823721D94AE6C00EB71B7 /* fill_filter_style.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = fill_filter_style.json; sourceTree = ""; }; @@ -2670,6 +2676,7 @@ he, da, "pt-PT", + ko, ); mainGroup = DA1DC9411CB6C1C2006E619F; productRefGroup = DA1DC94B1CB6C1C2006E619F /* Products */; @@ -3214,6 +3221,7 @@ DACBC60B20118ABE00C4D7E2 /* he */, DAD88E07202ACFE800AAA536 /* da */, DA93409B208562EB0059919A /* pt-PT */, + DAFEB3742093AE3700A86A83 /* ko */, ); name = Localizable.strings; sourceTree = ""; @@ -3242,6 +3250,7 @@ DACBC60E20118AFE00C4D7E2 /* he */, DAD88E0C202AD06500AAA536 /* da */, DA93409F208563440059919A /* pt-PT */, + DAFEB3792093AEA100A86A83 /* ko */, ); name = Root.strings; sourceTree = ""; @@ -3268,6 +3277,7 @@ DACBC60D20118ADE00C4D7E2 /* he */, DAD88E0A202AD03C00AAA536 /* da */, DA93409D208563220059919A /* pt-PT */, + DAFEB3772093AE7900A86A83 /* ko */, ); name = Localizable.strings; sourceTree = ""; @@ -3291,6 +3301,7 @@ DA3389661FA3EE28001EA329 /* bg */, DACBC60C20118AD000C4D7E2 /* he */, DAD88E08202AD01300AAA536 /* da */, + DAFEB3752093AE4800A86A83 /* ko */, ); name = Foundation.strings; sourceTree = ""; @@ -3315,6 +3326,7 @@ DA80E9611FE84AEF0065FC9B /* ar */, DAD88E09202AD01F00AAA536 /* da */, DA93409C2085630C0059919A /* pt-PT */, + DAFEB3762093AE6800A86A83 /* ko */, ); name = Foundation.stringsdict; sourceTree = ""; @@ -3345,6 +3357,7 @@ DA3389691FA3EE50001EA329 /* bg */, DAD88E0B202AD04D00AAA536 /* da */, DA93409E208563360059919A /* pt-PT */, + DAFEB3782093AE9200A86A83 /* ko */, ); name = Localizable.stringsdict; sourceTree = ""; diff --git a/platform/ios/resources/ko.lproj/Localizable.strings b/platform/ios/resources/ko.lproj/Localizable.strings new file mode 100644 index 0000000000..40136803d1 --- /dev/null +++ b/platform/ios/resources/ko.lproj/Localizable.strings @@ -0,0 +1,117 @@ +/* Accessibility hint */ +"ANNOTATION_A11Y_HINT" = "추가 정보 보기"; + +/* No comment provided by engineer. */ +"API_CLIENT_400_DESC" = "세션 데이타 작업 실패. 초기 요청: %@"; + +/* No comment provided by engineer. */ +"API_CLIENT_400_REASON" = "상태 코드 %ld"; + +/* No comment provided by engineer. */ +"CANCEL" = "취소"; + +/* Accessibility hint for closing the selected annotation’s callout view and returning to the map */ +"CLOSE_CALLOUT_A11Y_HINT" = "지도로 복귀"; + +/* Accessibility hint */ +"COMPASS_A11Y_HINT" = "정북쪽으로 지도 회전"; + +/* Accessibility label */ +"COMPASS_A11Y_LABEL" = "나침반"; + +/* Compass abbreviation for north */ +"COMPASS_NORTH" = "북"; + +/* Instructions in Interface Builder designable; {key}, {plist file name} */ +"DESIGNABLE" = "맵박스에의한 지도를 출력하기 위해, %1$@ 를 %2$@에 당신의 접근 토큰으로 으로 설정하십시오. \n\n자세한 정보를 찾으시는 경우, 확인:"; + +/* Setup documentation URL display string; keep as short as possible */ +"FIRST_STEPS_URL" = "mapbox.com/help/first-steps-ios-sdk"; + +/* Accessibility hint */ +"INFO_A11Y_HINT" = "크레딧, 피드백 폼, 기타 보기"; + +/* Accessibility label */ +"INFO_A11Y_LABEL" = "이 맵에 관하여"; + +/* List separator */ +"LIST_SEPARATOR" = ", "; + +/* User-friendly error description */ +"LOAD_MAP_FAILED_DESC" = "알수 없는 에러로 인해 맵 로드에 실패하였습니다."; + +/* User-friendly error description */ +"LOAD_STYLE_FAILED_DESC" = "형식이 로드되지 않아, 맵 로드에 실패하였습니다."; + +/* Accessibility label */ +"LOGO_A11Y_LABEL" = "맵박스"; + +/* Accessibility label */ +"MAP_A11Y_LABEL" = "지도"; + +/* Map accessibility value; {number of visible annotations} */ +"MAP_A11Y_VALUE_ANNOTATIONS" = "%ld 주석 볼 수 있는."; + +/* Map accessibility value; {list of visible places} */ +"MAP_A11Y_VALUE_PLACES" = "가시거리 범위: %@."; + +/* Map accessibility value; {number of visible roads} */ +"MAP_A11Y_VALUE_ROADS" = "%ld 도로 볼 수 있는."; + +/* Map accessibility value; {zoom level} */ +"MAP_A11Y_VALUE_ZOOM" = "확대 %dx."; + +/* User-friendly error description */ +"PARSE_STYLE_FAILED_DESC" = "형식에 오류가 발생하여 맵 로드에 실패하였습니다."; + +/* String format for accessibility value for road feature; {starting compass direction}, {ending compass direction} */ +"ROAD_DIRECTION_A11Y_FMT" = "%1$@ to %2$@"; + +/* Accessibility value indicating that a road is a divided road (dual carriageway) */ +"ROAD_DIVIDED_A11Y_VALUE" = "분리 도로"; + +/* Accessibility value indicating that a road is a one-way road */ +"ROAD_ONEWAY_A11Y_VALUE" = "일방 통행"; + +/* String format for accessibility value for road feature; {route number} */ +"ROAD_REF_A11Y_FMT" = "경로 %@"; + +/* Action sheet title */ +"SDK_NAME" = "iOS를 위한 맵박스 지도 SDK"; + +/* Developer-only SDK update notification; {latest version, in format x.x.x} */ +"SDK_UPDATE_AVAILABLE" = "iOS버전 맵박스 지도 %@가 사용 가능합니다:"; + +/* User-friendly error description */ +"STYLE_NOT_FOUND_DESC" = "형식을 찾을 수 없거나 호환이 되지 않아, 맵 로드에 실패하였습니다."; + +/* Telemetry prompt message */ +"TELEMETRY_DISABLED_MSG" = "당신은 익명의 사용 데이타를 제공함으로써, 오픈스트리트맵과 맵박스의 향상에 기여하고 있습니다."; + +/* Telemetry prompt button */ +"TELEMETRY_DISABLED_OFF" = "참여하지 마십시오"; + +/* Telemetry prompt button */ +"TELEMETRY_DISABLED_ON" = "참여"; + +/* Telemetry prompt message */ +"TELEMETRY_ENABLED_MSG" = "당신은 익명의 사용 데이타를 제공함으로써, 오픈스트리트맵과 맵박스의 향상에 기여하고 있습니다."; + +/* Telemetry prompt button */ +"TELEMETRY_ENABLED_OFF" = "참여 중지"; + +/* Telemetry prompt button */ +"TELEMETRY_ENABLED_ON" = "참여 계속"; + +/* Telemetry prompt button */ +"TELEMETRY_MORE" = "좀 더 말해보세요"; + +/* Action in attribution sheet */ +"TELEMETRY_NAME" = "맵박스 텔레메트리"; + +/* Telemetry prompt title */ +"TELEMETRY_TITLE" = "더 나은 맵박스 지도 만들기"; + +/* Default user location annotation title */ +"USER_DOT_TITLE" = "당신의 위치"; + diff --git a/platform/ios/resources/ko.lproj/Localizable.stringsdict b/platform/ios/resources/ko.lproj/Localizable.stringsdict new file mode 100644 index 0000000000..fdde2639c6 --- /dev/null +++ b/platform/ios/resources/ko.lproj/Localizable.stringsdict @@ -0,0 +1,48 @@ + + + + + MAP_A11Y_VALUE_ANNOTATIONS + + NSStringLocalizedFormatKey + %#@count@ + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + ld + other + %d 주석 보이기 + + + MAP_A11Y_VALUE_ROADS + + NSStringLocalizedFormatKey + %#@count@ + count + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + ld + other + %d 도로 보이기 + + + MAP_A11Y_VALUE_ZOOM + + NSStringLocalizedFormatKey + %#@level@ + level + + NSStringFormatSpecTypeKey + NSStringPluralRuleType + NSStringFormatValueTypeKey + d + other + 확대 %dx + + + + -- cgit v1.2.1 From 8b713d937343c8c4aafb1387279c1eec11e5ab95 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 2 May 2018 12:34:50 -0700 Subject: [ios, macos] Avoid implicit capture of MBGLOfflineRegionObserver this pointer MBGLOfflineRegionObserver is owned by the offline database thread, and might be destroyed by the time the dispatch_async completes. Instead of implicitly capturing this, capture a copy of the MBGLOfflinePack weak pointer. --- platform/ios/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index ea7f819089..8f62d28ae3 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -14,6 +14,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) * Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) * Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) +* Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) ## 4.0.0 - April 19, 2018 -- cgit v1.2.1 From 0bd9eac1744124e135df03753baa7395917ccf23 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 2 May 2018 12:34:50 -0700 Subject: [ios, macos] Avoid implicit capture of MBGLOfflineRegionObserver this pointer MBGLOfflineRegionObserver is owned by the offline database thread, and might be destroyed by the time the dispatch_async completes. Instead of implicitly capturing this, capture a copy of the MBGLOfflinePack weak pointer. --- platform/ios/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e7277a2e10..438186c2b9 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## 3.7.7 + +* Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) + ## 3.7.6 - March 12, 2018 * Fixed an issue where full-resolution tiles could fail to replace lower-resolution placeholders. ([#11227](https://github.com/mapbox/mapbox-gl-native/pull/11227)) -- cgit v1.2.1 From 844a8244097c18ae12e9c14baaaaad8a2f7ef436 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Thu, 3 May 2018 09:11:42 -0400 Subject: [ios, macos] Fix broken link to predicates and expressions guide. (#11818) --- platform/ios/docs/guides/For Style Authors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md index b3beea8540..9a6e4428eb 100644 --- a/platform/ios/docs/guides/For Style Authors.md +++ b/platform/ios/docs/guides/For Style Authors.md @@ -280,7 +280,7 @@ Each property representing a layout or paint attribute is set to an but you create the former using a very different syntax. `NSExpression`’s format string syntax is reminiscent of a spreadsheet formula or an expression in a database query. See the -“[Predicates and Expressions](Predicates and Expressions.md)” guide for an +“[Predicates and Expressions](predicates-and-expressions.html)” guide for an overview of the expression support in this SDK. This SDK no longer supports style functions; use expressions instead. @@ -412,5 +412,5 @@ In style JSON | In the format string `["any", f0, …, fn]` | `p0 OR … OR pn` `["none", f0, …, fn]` | `NOT (p0 OR … OR pn)` -See the “[Predicates and Expressions](Predicates and Expressions.md)” guide for +See the “[Predicates and Expressions](predicates-and-expressions.html)” guide for a full description of the supported operators and operand types. -- cgit v1.2.1 From f6da3ba9be27ff9b279730603c517c4cb5e57007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 3 May 2018 21:48:58 +0200 Subject: iOS: Add custom layer example to debugging app (#7734) --- platform/ios/app/MBXViewController.m | 12 ++++++++++++ platform/ios/ios.xcodeproj/project.pbxproj | 18 ++++++++++++------ .../ios/uitest/ios-tests.xcodeproj/project.pbxproj | 4 ++++ 3 files changed, 28 insertions(+), 6 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 391af5ea05..c3585fbeae 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -5,6 +5,7 @@ #import "MBXOfflinePacksTableViewController.h" #import "MBXAnnotationView.h" #import "MBXUserLocationAnnotationView.h" +#import "LimeGreenStyleLayer.h" #import "MBXEmbeddedMapViewController.h" #import @@ -82,6 +83,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsRuntimeStylingRows) { MBXSettingsRuntimeStylingRasterTileSource, MBXSettingsRuntimeStylingImageSource, MBXSettingsRuntimeStylingRouteLine, + MBXSettingsRuntimeStylingAddLimeGreenTriangleLayer, MBXSettingsRuntimeStylingDDSPolygon, MBXSettingsRuntimeStylingCustomLatLonGrid, }; @@ -371,6 +373,7 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { @"Style Raster Tile Source", @"Style Image Source", @"Add Route Line", + @"Add Lime Green Triangle Layer", @"Dynamically Style Polygon", @"Add Custom Lat/Lon Grid", ]]; @@ -559,6 +562,9 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { case MBXSettingsRuntimeStylingRouteLine: [self styleRouteLine]; break; + case MBXSettingsRuntimeStylingAddLimeGreenTriangleLayer: + [self styleAddLimeGreenTriangleLayer]; + break; case MBXSettingsRuntimeStylingDDSPolygon: [self stylePolygonWithDDS]; break; @@ -1443,6 +1449,12 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { [self.mapView.style addLayer:routeLayer]; } +- (void)styleAddLimeGreenTriangleLayer +{ + LimeGreenStyleLayer *layer = [[LimeGreenStyleLayer alloc] initWithIdentifier:@"mbx-custom"]; + [self.mapView.style addLayer:layer]; +} + - (void)stylePolygonWithDDS { CLLocationCoordinate2D leftCoords[] = { {37.73081027834234, -122.49412536621094}, diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index f5d50522ef..c7708b2d37 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -158,6 +158,9 @@ 35E79F201D41266300957B9E /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */; }; 35E79F211D41266300957B9E /* MGLStyleLayer_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */; }; 36F1153D1D46080700878E1A /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 36F1153B1D46080700878E1A /* libmbgl-core.a */; }; + 3E6465D62065767A00685536 /* LimeGreenStyleLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */; }; + 3E8770612074297100B7E842 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; }; + 3E8E82F120744B4100E7BE97 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E8E82F020744B4100E7BE97 /* libmbgl-core.a */; }; 3EA93369F61CF70AFA50465D /* MGLRendererConfiguration.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3EA931BC4F087E166D538F21 /* MGLRendererConfiguration.mm */; }; 3EA934623AD0000B7D99C3FB /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */; }; 3EA9363147E77DD29FA06063 /* MGLRendererConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */; }; @@ -266,9 +269,6 @@ 40F887701D7A1E58008ECB67 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */; }; 40F887711D7A1E59008ECB67 /* MGLShapeSource_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 40F8876F1D7A1DB8008ECB67 /* MGLShapeSource_Private.h */; }; 40FDA76B1CCAAA6800442548 /* MBXAnnotationView.m in Sources */ = {isa = PBXBuildFile; fileRef = 40FDA76A1CCAAA6800442548 /* MBXAnnotationView.m */; }; - 5549A0381EF1D86B00073113 /* libmbgl-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5549A0371EF1D86B00073113 /* libmbgl-core.a */; }; - 5549A0391EF2877100073113 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; }; - 5549A03A1EF2877500073113 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 554180411D2E97DE00012372 /* OpenGLES.framework */; }; 556660CA1E1BF3A900E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 556660D81E1D085500E2C41B /* MGLVersionNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = 556660D71E1D085500E2C41B /* MGLVersionNumber.m */; }; 556660DB1E1D8E8D00E2C41B /* MGLFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 556660C91E1BF3A900E2C41B /* MGLFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -829,6 +829,9 @@ 35E79F1F1D41266300957B9E /* MGLStyleLayer_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLStyleLayer_Private.h; sourceTree = ""; }; 36F1153B1D46080700878E1A /* libmbgl-core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-core.a"; path = "build/Debug-iphoneos/libmbgl-core.a"; sourceTree = ""; }; 36F1153C1D46080700878E1A /* libmbgl-platform-ios.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libmbgl-platform-ios.a"; path = "build/Debug-iphoneos/libmbgl-platform-ios.a"; sourceTree = ""; }; + 3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LimeGreenStyleLayer.m; path = ../../darwin/app/LimeGreenStyleLayer.m; sourceTree = ""; }; + 3E6465D52065767A00685536 /* LimeGreenStyleLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LimeGreenStyleLayer.h; path = ../../darwin/app/LimeGreenStyleLayer.h; sourceTree = ""; }; + 3E8E82F020744B4100E7BE97 /* libmbgl-core.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-core.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3EA931BC4F087E166D538F21 /* MGLRendererConfiguration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLRendererConfiguration.mm; sourceTree = ""; }; 3EA9337830C7738BF7F5493C /* MGLRendererConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLRendererConfiguration.h; sourceTree = ""; }; 400532FF1DB0862B0069F638 /* NSArray+MGLAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+MGLAdditions.h"; sourceTree = ""; }; @@ -1297,7 +1300,6 @@ buildActionMask = 2147483647; files = ( DA8847D91CBAF91600AB86E3 /* Mapbox.framework in Frameworks */, - 5549A0391EF2877100073113 /* OpenGLES.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1305,7 +1307,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 5549A0381EF1D86B00073113 /* libmbgl-core.a in Frameworks */, + 3E8E82F120744B4100E7BE97 /* libmbgl-core.a in Frameworks */, DA2E88561CC036F400F24E7B /* Mapbox.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1336,7 +1338,7 @@ buildActionMask = 2147483647; files = ( DAA4E4081CBB6C9500178DFB /* Mapbox.framework in Frameworks */, - 5549A03A1EF2877500073113 /* OpenGLES.framework in Frameworks */, + 3E8770612074297100B7E842 /* OpenGLES.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1730,6 +1732,8 @@ DA1DC94C1CB6C1C2006E619F /* Demo App */ = { isa = PBXGroup; children = ( + 3E6465D52065767A00685536 /* LimeGreenStyleLayer.h */, + 3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */, DA1DC9501CB6C1C2006E619F /* MBXAppDelegate.h */, DA1DC9981CB6E054006E619F /* MBXAppDelegate.m */, 40FDA7691CCAAA6800442548 /* MBXAnnotationView.h */, @@ -1769,6 +1773,7 @@ DA1DC9921CB6DF24006E619F /* Frameworks */ = { isa = PBXGroup; children = ( + 3E8E82F020744B4100E7BE97 /* libmbgl-core.a */, 55D120AD1F791018004B6D81 /* libmbgl-loop-darwin.a */, 55D120AB1F791015004B6D81 /* libmbgl-filesource.a */, 55D120A91F79100C004B6D81 /* libmbgl-filesource.a */, @@ -2824,6 +2829,7 @@ 927FBCFC1F4DAA8300F8BF1F /* MBXSnapshotsViewController.m in Sources */, DA1DC99B1CB6E064006E619F /* MBXViewController.m in Sources */, 40FDA76B1CCAAA6800442548 /* MBXAnnotationView.m in Sources */, + 3E6465D62065767A00685536 /* LimeGreenStyleLayer.m in Sources */, 632281DF1E6F855900D75A5D /* MBXEmbeddedMapViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/platform/ios/uitest/ios-tests.xcodeproj/project.pbxproj b/platform/ios/uitest/ios-tests.xcodeproj/project.pbxproj index c9744d41bf..108139e6e3 100644 --- a/platform/ios/uitest/ios-tests.xcodeproj/project.pbxproj +++ b/platform/ios/uitest/ios-tests.xcodeproj/project.pbxproj @@ -47,6 +47,8 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 3EAB52CE206ACE7E008BFE2D /* libmbgl-loop-darwin.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libmbgl-loop-darwin.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3EAB52CF206ACE7E008BFE2D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 96567A221B0E84CD00D78776 /* LaunchScreen.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LaunchScreen.xib; sourceTree = SOURCE_ROOT; }; 96567A301B0E8BB900D78776 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = SOURCE_ROOT; }; DA180EF11DD1A4DF000A211D /* OHHTTPStubs.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OHHTTPStubs.framework; path = "OHHTTPStubs/OHHTTPStubs/build/Debug-iphoneos/OHHTTPStubs.framework"; sourceTree = ""; }; @@ -122,6 +124,8 @@ DD043325196DB9BC00E6F39D /* Frameworks */ = { isa = PBXGroup; children = ( + 3EAB52CF206ACE7E008BFE2D /* OpenGLES.framework */, + 3EAB52CE206ACE7E008BFE2D /* libmbgl-loop-darwin.a */, DA180EF11DD1A4DF000A211D /* OHHTTPStubs.framework */, DA9C551B1CD9DFA7000A15C6 /* libKIF.a */, DA482C7F1C12582600772FE3 /* Mapbox.framework */, -- cgit v1.2.1 From aadaa1c95b3f52483d1513efdff0b6d06c6c5420 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Thu, 3 May 2018 17:36:02 -0400 Subject: [ios] Prepare ios-v3.7.7 release (#11828) Bring ios-v4.0.0 changelog backward --- platform/ios/CHANGELOG.md | 72 +++++++++++++++++++++- .../ios/Mapbox-iOS-SDK-nightly-dynamic.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 4 files changed, 73 insertions(+), 5 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 438186c2b9..392df1d1ea 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,9 +2,77 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. -## 3.7.7 +## 3.7.7 - May 3, 2018 -* Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) +* Fixed a crash when removing an `MGLOfflinePack`. ([#11821](https://github.com/mapbox/mapbox-gl-native/issues/11821)) + +## 4.0.0 - April 19, 2018 + +The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iOS deployment version will increase to iOS 9.0 in a future release. + +### Packaging + +* Removed support for 32-bit simulators. ([#10962](https://github.com/mapbox/mapbox-gl-native/pull/10962)) +* Added Danish, Hebrew, and European Portuguese localizations. ([#10967](https://github.com/mapbox/mapbox-gl-native/pull/10967), [#11136](https://github.com/mapbox/mapbox-gl-native/pull/11134), [#11695](https://github.com/mapbox/mapbox-gl-native/pull/11695)) +* Removed methods, properties, and constants that had been deprecated as of v3.7.6. ([#11205](https://github.com/mapbox/mapbox-gl-native/pull/11205), [#11681](https://github.com/mapbox/mapbox-gl-native/pull/11681)) +* Refined certain Swift interfaces by converting them from class methods to class properties. ([#11674](https://github.com/mapbox/mapbox-gl-native/pull/11674)) +* Revamped the “Adding Points to a Map” guide. ([#11496](https://github.com/mapbox/mapbox-gl-native/pull/11496)) + +### Style layers + +* The layout and paint properties on subclasses of `MGLStyleLayer` are now of type `NSExpression` instead of `MGLStyleValue`. A new “Predicates and Expressions” guide provides an overview of the supported operators, which include arithmetic and conditional operators. ([#10726](https://github.com/mapbox/mapbox-gl-native/pull/10726)) +* A style can now display a heatmap layer that visualizes a point data distribution. You can customize the appearance at runtime using the `MGLHeatmapStyleLayer` class. ([#11046](https://github.com/mapbox/mapbox-gl-native/pull/11046)) +* A style can now display a smooth hillshading layer and customize its appearance at runtime using the `MGLHillshadeStyleLayer` class. Hillshading is based on a rasterized digital elevation model supplied by the `MGLRasterDEMSource` class. ([#10642](https://github.com/mapbox/mapbox-gl-native/pull/10642)) +* You can now set the `MGLVectorStyleLayer.predicate` property to a predicate that contains arithmetic and calls to built-in `NSExpression` functions. You may need to cast a feature attribute key to `NSString` or `NSNumber` before comparing it to a string or number. ([#11587](https://github.com/mapbox/mapbox-gl-native/pull/11587)) +* Replaced the `MGLStyle.localizesLabels` property with an `-[MGLStyle localizeLabelsIntoLocale:]` method that allows you to specify the language to localize into. Also added an `-[NSExpression(MGLAdditions) mgl_expressionLocalizedIntoLocale:]` method for localizing an individual value used with `MGLSymbolStyleLayer.text`. ([#11651](https://github.com/mapbox/mapbox-gl-native/pull/11651)) +* The `MGLSymbolStyleLayer.textFontNames` property can now depend on a feature’s attributes. ([#10850](https://github.com/mapbox/mapbox-gl-native/pull/10850)) +* Changes to the `MGLStyleLayer.minimumZoomLevel` and `MGLStyleLayer.maximumZoomLevel` properties take effect immediately. ([#11399](https://github.com/mapbox/mapbox-gl-native/pull/11399)) + +### Content sources + +* Renamed `MGLRasterSource` to `MGLRasterTileSource` and `MGLVectorSource` to `MGLVectorTileSource`. ([#11568](https://github.com/mapbox/mapbox-gl-native/pull/11568)) +* Added an `MGLComputedShapeSource` class that allows applications to supply vector data to a style layer on a per-tile basis. ([#9983](https://github.com/mapbox/mapbox-gl-native/pull/9983)) +* Properties such as `MGLSymbolStyleLayer.iconAllowsOverlap` and `MGLSymbolStyleLayer.iconIgnoresPlacement` now account for symbols in other sources. ([#10436](https://github.com/mapbox/mapbox-gl-native/pull/10436)) + +### Map rendering + +* Improved the reliability of collision detection between symbols near the edges of tiles, as well as between symbols when the map is tilted. It is no longer necessary to enable `MGLSymbolStyleLayer.symbolAvoidsEdges` to prevent symbols in adjacent tiles from overlapping with each other. ([#10436](https://github.com/mapbox/mapbox-gl-native/pull/10436)) +* Symbols can fade in and out as the map pans, rotates, or tilts. ([#10436](https://github.com/mapbox/mapbox-gl-native/pull/10436)) +* Fixed an issue preventing a dynamically-added `MGLRasterStyleLayer` from drawing until the map pans. ([#10270](https://github.com/mapbox/mapbox-gl-native/pull/10270)) +* Fixed an issue preventing `MGLImageSource`s from drawing on the map when the map is zoomed in and tilted. ([#10677](https://github.com/mapbox/mapbox-gl-native/pull/10677)) +* Improved the sharpness of raster tiles on Retina displays. ([#10984](https://github.com/mapbox/mapbox-gl-native/pull/10984)) +* Fixed a crash parsing a malformed style. ([#11001](https://github.com/mapbox/mapbox-gl-native/pull/11001)) +* Reduced memory usage by clearing in-memory tile cache before entering background. ([#11197](https://github.com/mapbox/mapbox-gl-native/pull/11197)) +* Fixed an issue where symbols with empty labels would always be hidden. ([#11206](https://github.com/mapbox/mapbox-gl-native/pull/11206)) +* Fixed an issue where a tilted map could flicker while displaying rotating symbols. ([#11488](https://github.com/mapbox/mapbox-gl-native/pull/11488)) +* Increased the maximum width of labels by a factor of two. ([#11508](https://github.com/mapbox/mapbox-gl-native/pull/11508)) + +### Annotations + +* Changed the default value of `MGLAnnotationView.scalesWithViewingDistance` to `NO`, to improve performance. If your use case involves many annotation views, consider keeping this property disabled. ([#11636](https://github.com/mapbox/mapbox-gl-native/pull/11636)) +* Fixed an issue preventing `MGLAnnotationImage.image` from being updated. ([#10372](https://github.com/mapbox/mapbox-gl-native/pull/10372)) +* Improved performance of `MGLAnnotationView`-backed annotations that have `scalesWithViewingDistance` enabled. ([#10951](https://github.com/mapbox/mapbox-gl-native/pull/10951)) +* Fixed an issue where tapping a group of annotations may not have selected the nearest annotation. ([#11438](https://github.com/mapbox/mapbox-gl-native/pull/11438)) +* The `MGLMapView.selectedAnnotations` property (backed by `-[MGLMapView setSelectedAnnotations:]`) now selects annotations that are off-screen. ([#9790](https://github.com/mapbox/mapbox-gl-native/issues/9790)) +* The `animated` parameter to `-[MGLMapView selectAnnotation:animated:]` now controls whether the annotation and its callout are brought on-screen. If `animated` is `NO` then the annotation is selected if offscreen, but the map is not panned. Currently only point annotations are supported. Setting the `MGLMapView.selectedAnnotations` property now animates. ([#3249](https://github.com/mapbox/mapbox-gl-native/issues/3249)) +* Fixed a crash when rapidly adding and removing annotations. ([#11551](https://github.com/mapbox/mapbox-gl-native/issues/11551), [#11575](https://github.com/mapbox/mapbox-gl-native/issues/11575)) +* Marked protocol method `-[MGLCalloutView presentCalloutFromRect:inView:constrainedToView:animated:]` as unavailable. Use `-[MGLCalloutView presentCalloutFromRect:inView:constrainedToRect:animated:]` instead. ([#11738](https://github.com/mapbox/mapbox-gl-native/pull/11738)) + +### Map snapshots + +* Fixed a memory leak that occurred when creating a map snapshot. ([#10585](https://github.com/mapbox/mapbox-gl-native/pull/10585)) + +### Other changes + +* The `-[MGLMapView convertRect:toCoordinateBoundsFromView:]` method and the `MGLMapView.visibleCoordinateBounds` property’s getter now indicate that the coordinate bounds straddles the antimeridian by extending one side beyond ±180 degrees longitude. ([#11265](https://github.com/mapbox/mapbox-gl-native/pull/11265)) +* Feature querying results now account for the `MGLSymbolStyleLayer.circleStrokeWidth` property. ([#10897](https://github.com/mapbox/mapbox-gl-native/pull/10897)) +* Fixed an issue preventing labels from being transliterated when VoiceOver was enabled on iOS 10._x_ and below. ([#10881](https://github.com/mapbox/mapbox-gl-native/pull/10881)) +* Labels are now transliterated from more languages when VoiceOver is enabled. ([#10881](https://github.com/mapbox/mapbox-gl-native/pull/10881)) +* Long-pressing the attribution button causes the SDK’s version number to be displayed in the action sheet that appears. ([#10650](https://github.com/mapbox/mapbox-gl-native/pull/10650)) +* Reduced offline download sizes for styles with symbol layers that render only icons, and no text. ([#11055](https://github.com/mapbox/mapbox-gl-native/pull/11055)) +* Added haptic feedback that occurs when the user rotates the map to due north, configurable via `MGLMapView.hapticFeedbackEnabled`. ([#10847](https://github.com/mapbox/mapbox-gl-native/pull/10847)) +* Added `MGLMapView.showsScale` as the recommended way to show the scale bar. This property can be set directly in Interface Builder. ([#11335](https://github.com/mapbox/mapbox-gl-native/pull/11335)) +* Fixed an issue where the scale bar would not appear until the map had moved. ([#11335](https://github.com/mapbox/mapbox-gl-native/pull/11335)) ## 3.7.6 - March 12, 2018 diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec index 268b7b9da6..9d714ccb6a 100644 --- a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec +++ b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.6' + version = '3.7.7' m.name = 'Mapbox-iOS-SDK-nightly-dynamic' m.version = "#{version}-nightly" diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index a1b2441d29..ebf758cbf6 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.6' + version = '3.7.7' m.name = 'Mapbox-iOS-SDK-symbols' m.version = "#{version}-symbols" diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 7e696a23cf..d8ac87363b 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.6' + version = '3.7.7' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1 From 1b9c8b5ca72c8863ba2fd674f327fcc145753c1f Mon Sep 17 00:00:00 2001 From: Julian Rex Date: Thu, 3 May 2018 20:36:37 -0400 Subject: [ios] Switched to use center property (instead of frame) when repositioning annotation views (when adding back into queue). (#11817) --- platform/ios/CHANGELOG.md | 7 ++++++- platform/ios/src/MGLMapView.mm | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 8f62d28ae3..e28510f80d 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -8,11 +8,16 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) + +### Annotations + +* Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) +* Fixed an issue where annotation views could become distorted if `rotatesToMatchCamera` is `YES`. ([#11817](https://github.com/mapbox/mapbox-gl-native/pull/11817)) + ### Other changes * Added a Korean localization. ([#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792)) * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) -* Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) * Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) * Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 34269ce442..0e1f786a39 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -5725,10 +5725,12 @@ public: if (annotationView.layer.animationKeys.count > 0) { continue; } + // Move the annotation view far out of view to the left - CGRect adjustedFrame = annotationView.frame; - adjustedFrame.origin.x = -CGRectGetWidth(self.frame) * 10.0; - annotationView.frame = adjustedFrame; + CGPoint adjustedCenter = annotationView.center; + adjustedCenter.x = -CGRectGetWidth(self.frame) * 10.0; + annotationView.center = adjustedCenter; + [self enqueueAnnotationViewForAnnotationContext:annotationContext]; } } -- cgit v1.2.1 From 167a2321d98b0733527fd4f94c11a2f33fb243e5 Mon Sep 17 00:00:00 2001 From: Jordan Kiley Date: Fri, 4 May 2018 09:40:51 -0700 Subject: [ios, macos] Update migration guides in jazzy table (#11808) * [macos] update jazzy for macos * [ios] moved migration guide --- platform/ios/jazzy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/ios') diff --git a/platform/ios/jazzy.yml b/platform/ios/jazzy.yml index 34dcc1f50b..d3aae51b77 100644 --- a/platform/ios/jazzy.yml +++ b/platform/ios/jazzy.yml @@ -19,10 +19,10 @@ custom_categories: children: - Adding Markers to a Map - Runtime Styling - - Migrating to Expressions - Working with Mapbox Studio - Working with GeoJSON Data - Predicates and Expressions + - Migrating to Expressions - For Style Authors - Tile URL Templates - Info.plist Keys -- cgit v1.2.1 From 86a2e93294b472898cfd005a4c34818551de0728 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Fri, 4 May 2018 12:49:58 -0400 Subject: [ios, macos] Fix overlay bounds that span the antimeridian. (#11783) * [ios, macos] Fix overlay bounds that span the antimeridian. * [ios, macos] Update changelogs. * [ios, macos] Make MGLLocationCoordinate2DIsValid private. * [ios, macos] Update changelogs. --- platform/ios/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index e28510f80d..8fc1f7e1e0 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -20,6 +20,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) * Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) * Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) +* Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) ## 4.0.0 - April 19, 2018 -- cgit v1.2.1 From 1c847b321b401a473a45f839d7e53c27836c1393 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Fri, 4 May 2018 13:30:06 -0400 Subject: [ios, macos] Add support for subscripting in expressions. (#11770) * [ios, macos] Add support for subscripting in expressions. * [ios, macos] Update changelogs. * [ios, macos] Refactor LAST subscripting expression. --- platform/ios/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 8fc1f7e1e0..d979021760 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -7,6 +7,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Style layers * Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) +* Added `FISRT`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770)) ### Annotations -- cgit v1.2.1 From a365dd11da0f4c41ad793ea1e3db3cef8e3cbce8 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Fri, 4 May 2018 15:09:07 -0400 Subject: [ios, macos] Make NSPredicate+MGLAdditions public. (#11810) --- platform/ios/ios.xcodeproj/project.pbxproj | 10 ++++++++-- platform/ios/src/MGLMapView.mm | 2 +- platform/ios/src/Mapbox.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index c7708b2d37..46c10dab89 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -36,6 +36,8 @@ 1F7454971ECD450D00021D39 /* MGLLight_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F7454941ECD450D00021D39 /* MGLLight_Private.h */; }; 1F7454A91ED08AB400021D39 /* MGLLightTest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F7454A61ED08AB400021D39 /* MGLLightTest.mm */; }; 1F95931D1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */; }; + 1FC4817D2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */; }; + 1FC4817F2098CD80000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */; }; 30E578171DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; }; 30E578181DAA85520050F07E /* UIImage+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E578111DAA7D690050F07E /* UIImage+MGLAdditions.h */; }; 30E578191DAA855E0050F07E /* UIImage+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 30E578121DAA7D690050F07E /* UIImage+MGLAdditions.mm */; }; @@ -130,8 +132,8 @@ 357FE2E01E02D2B20068B753 /* NSCoder+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 357FE2DC1E02D2B20068B753 /* NSCoder+MGLAdditions.mm */; }; 3598544D1E1D38AA00B29F84 /* MGLDistanceFormatterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3598544C1E1D38AA00B29F84 /* MGLDistanceFormatterTests.m */; }; 359F57461D2FDDA6005217F1 /* MGLUserLocationAnnotationView_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 359F57451D2FDBD5005217F1 /* MGLUserLocationAnnotationView_Private.h */; }; - 35B82BF81D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; }; - 35B82BF91D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; }; + 35B82BF81D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 35B82BF91D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; 35B82BFA1D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35B82BF71D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm */; }; 35B82BFB1D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35B82BF71D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm */; }; 35B8E08C1D6C8B5100E768D2 /* MGLPredicateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 35B8E08B1D6C8B5100E768D2 /* MGLPredicateTests.mm */; }; @@ -753,6 +755,7 @@ 1F7454941ECD450D00021D39 /* MGLLight_Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLLight_Private.h; sourceTree = ""; }; 1F7454A61ED08AB400021D39 /* MGLLightTest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLLightTest.mm; path = ../../darwin/test/MGLLightTest.mm; sourceTree = ""; }; 1F95931C1E6DE2E900D5B294 /* MGLNSDateAdditionsTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MGLNSDateAdditionsTests.mm; path = ../../darwin/test/MGLNSDateAdditionsTests.mm; sourceTree = ""; }; + 1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSPredicate+MGLPrivateAdditions.h"; sourceTree = ""; }; 20DABE861DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Foundation.strings"; sourceTree = ""; }; 20DABE881DF78148007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 20DABE8A1DF78149007AC5FF /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Root.strings"; sourceTree = ""; }; @@ -2111,6 +2114,7 @@ 3510FFEF1D6D9D8C00F413B2 /* NSExpression+MGLAdditions.mm */, 35B82BF61D6C5F8400B1B721 /* NSPredicate+MGLAdditions.h */, 35B82BF71D6C5F8400B1B721 /* NSPredicate+MGLAdditions.mm */, + 1FC4817B2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h */, DA8848151CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.h */, DA8848161CBAFA6200AB86E3 /* NSProcessInfo+MGLAdditions.m */, DA8848171CBAFA6200AB86E3 /* NSString+MGLAdditions.h */, @@ -2199,6 +2203,7 @@ DA88483B1CBAFB8500AB86E3 /* MGLCalloutView.h in Headers */, 35E0CFE61D3E501500188327 /* MGLStyle_Private.h in Headers */, 3510FFF01D6D9D8C00F413B2 /* NSExpression+MGLAdditions.h in Headers */, + 1FC4817D2098CBC0000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */, 353AFA141D65AB17005A69F4 /* NSDate+MGLAdditions.h in Headers */, DA8848531CBAFB9800AB86E3 /* MGLCompactCalloutView.h in Headers */, DA8847FB1CBAFA5100AB86E3 /* MGLShape.h in Headers */, @@ -2378,6 +2383,7 @@ 96E516F920005A3500A02306 /* MGLFaux3DUserLocationAnnotationView.h in Headers */, 96E516F22000596D00A02306 /* NSException+MGLAdditions.h in Headers */, 96E516EC2000560B00A02306 /* MGLUserLocationAnnotationView_Private.h in Headers */, + 1FC4817F2098CD80000D09B4 /* NSPredicate+MGLPrivateAdditions.h in Headers */, DABFB8671CBE99E500D62B32 /* MGLPolygon.h in Headers */, 404C26E81D89C55D000AA13D /* MGLTileSource_Private.h in Headers */, 1F7454931ECBB43F00021D39 /* MGLLight.h in Headers */, diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 0e1f786a39..71f308caf0 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -49,7 +49,7 @@ #import "NSBundle+MGLAdditions.h" #import "NSDate+MGLAdditions.h" #import "NSException+MGLAdditions.h" -#import "NSPredicate+MGLAdditions.h" +#import "NSPredicate+MGLPrivateAdditions.h" #import "NSProcessInfo+MGLAdditions.h" #import "NSString+MGLAdditions.h" #import "NSURL+MGLAdditions.h" diff --git a/platform/ios/src/Mapbox.h b/platform/ios/src/Mapbox.h index 20417dbbd4..7beb8b766b 100644 --- a/platform/ios/src/Mapbox.h +++ b/platform/ios/src/Mapbox.h @@ -66,3 +66,4 @@ FOUNDATION_EXPORT MGL_EXPORT const unsigned char MapboxVersionString[]; #import "MGLAttributionInfo.h" #import "MGLMapSnapshotter.h" #import "NSExpression+MGLAdditions.h" +#import "NSPredicate+MGLAdditions.h" -- cgit v1.2.1 From a425995189c3f4c9d9040b4acff477bfc96b6afd Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Mon, 7 May 2018 12:01:29 -0400 Subject: [ios, macos] Add to-rgba expression operator. (#11725) * [ios, macos] Add expression support to to-rgba operator. * [ios, macos] Update style docs. * [ios, macos] Refactored to-rgba to to-color. * [ios, macos] Add support for to-rgba expression operator. * [ios, macos] Add multiple parameters support to to-color operand. * [ios, macos] Enable to-rgba operator for MGLColor or key path expressions. * [ios, macos] Update predicates and expressions guide to reflect cast changes. * [ios, macos] Update changelogs. * [ios, macos] Clarify color casting usage. --- platform/ios/CHANGELOG.md | 1 + platform/ios/docs/guides/For Style Authors.md | 4 ++-- platform/ios/src/UIColor+MGLAdditions.mm | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index d979021760..057149190c 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -22,6 +22,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) * Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) * Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) +* Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725)) ## 4.0.0 - April 19, 2018 diff --git a/platform/ios/docs/guides/For Style Authors.md b/platform/ios/docs/guides/For Style Authors.md index 9a6e4428eb..d4fb17eb6a 100644 --- a/platform/ios/docs/guides/For Style Authors.md +++ b/platform/ios/docs/guides/For Style Authors.md @@ -325,7 +325,7 @@ In style specification | Method, function, or predicate type | Format string syn `number` | | `string` | | `to-boolean` | `boolValue` | -`to-color` | | +`to-color` | | `CAST(var, 'UIColor')` `to-number` | `mgl_numberWithFallbackValues:` | `CAST(zipCode, 'NSNumber')` `to-string` | `stringValue` | `CAST(ele, 'NSString')` `typeof` | | @@ -357,7 +357,7 @@ In style specification | Method, function, or predicate type | Format string syn `upcase` | `uppercase:` | `uppercase('Elysian Fields')` `rgb` | `+[UIColor colorWithRed:green:blue:alpha:]` | `rgba` | `+[UIColor colorWithRed:green:blue:alpha:]` | -`to-rgba` | | +`to-rgba` | | `CAST(noindex(var), 'NSArray')` `-` | `from:subtract:` | `2 - 1` `*` | `multiply:by:` | `1 * 2` `/` | `divide:by:` | `1 / 2` diff --git a/platform/ios/src/UIColor+MGLAdditions.mm b/platform/ios/src/UIColor+MGLAdditions.mm index 9ca39acda4..7c1fbddc20 100644 --- a/platform/ios/src/UIColor+MGLAdditions.mm +++ b/platform/ios/src/UIColor+MGLAdditions.mm @@ -66,7 +66,7 @@ return [UIColor colorWithRed:[components[0].constantValue doubleValue] / 255.0 green:[components[1].constantValue doubleValue] / 255.0 blue:[components[2].constantValue doubleValue] / 255.0 - alpha:components.count == 3 ? [components[3].constantValue doubleValue] : 1.0]; + alpha:components.count == 3 ? 1.0 : [components[3].constantValue doubleValue]]; } @end -- cgit v1.2.1 From 0141f65e7be21b067957a8e8cb3474ab46e12b48 Mon Sep 17 00:00:00 2001 From: Randall Lee Date: Mon, 7 May 2018 17:57:42 -0400 Subject: [iOS] - Update telemetry certificate pinning (#11845) * Update telemetry certificate pinning * Load both CN certificates * [ios] Use China events endpoint with China API endpoint * Update CHANGELOG.md --- platform/ios/CHANGELOG.md | 4 ++++ platform/ios/ios.xcodeproj/project.pbxproj | 12 ++++++++++++ .../ios/resources/api_mapbox_cn-digicert_2018.der | Bin 0 -> 1704 bytes .../ios/resources/api_mapbox_cn-geotrust_2018.der | Bin 0 -> 1578 bytes platform/ios/src/MGLAPIClient.m | 18 +++++++++++++++++- 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 platform/ios/resources/api_mapbox_cn-digicert_2018.der create mode 100644 platform/ios/resources/api_mapbox_cn-geotrust_2018.der (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 392df1d1ea..1b0806b689 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## 3.7.8 - May 7, 2018 + +* Improved compatibility with Mapbox China APIs. ([#11845](https://github.com/mapbox/mapbox-gl-native/pull/11845)) + ## 3.7.7 - May 3, 2018 * Fixed a crash when removing an `MGLOfflinePack`. ([#11821](https://github.com/mapbox/mapbox-gl-native/issues/11821)) diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index bbd4067534..2bc216ff1c 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -247,6 +247,10 @@ 968F36B51E4D128D003A5522 /* MGLDistanceFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = 3557F7AE1E1D27D300CCA5E6 /* MGLDistanceFormatter.h */; settings = {ATTRIBUTES = (Public, ); }; }; 96E027231E57C76E004B8E66 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 96E027251E57C76E004B8E66 /* Localizable.strings */; }; 96F3F73C1F57124B003E2D2C /* MGLUserLocationHeadingIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 96F3F73B1F5711F1003E2D2C /* MGLUserLocationHeadingIndicator.h */; }; + AC0C15F3209D0E6900B65675 /* api_mapbox_cn-geotrust_2018.der in Resources */ = {isa = PBXBuildFile; fileRef = AC0C15F1209D0E3600B65675 /* api_mapbox_cn-geotrust_2018.der */; }; + AC0C15F4209D0E7000B65675 /* api_mapbox_cn-geotrust_2018.der in Resources */ = {isa = PBXBuildFile; fileRef = AC0C15F1209D0E3600B65675 /* api_mapbox_cn-geotrust_2018.der */; }; + AC0C15F5209D0E7200B65675 /* api_mapbox_cn-digicert_2018.der in Resources */ = {isa = PBXBuildFile; fileRef = AC0C15F2209D0E6000B65675 /* api_mapbox_cn-digicert_2018.der */; }; + AC0C15F6209D0E7300B65675 /* api_mapbox_cn-digicert_2018.der in Resources */ = {isa = PBXBuildFile; fileRef = AC0C15F2209D0E6000B65675 /* api_mapbox_cn-digicert_2018.der */; }; AC518DFF201BB55A00EBC820 /* MGLTelemetryConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = AC518DFD201BB55A00EBC820 /* MGLTelemetryConfig.h */; }; AC518E00201BB55A00EBC820 /* MGLTelemetryConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = AC518DFD201BB55A00EBC820 /* MGLTelemetryConfig.h */; }; AC518E03201BB56000EBC820 /* MGLTelemetryConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */; }; @@ -756,6 +760,8 @@ 96E0272D1E57C7E6004B8E66 /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = vi.lproj/Localizable.strings; sourceTree = ""; }; 96E0272E1E57C7E7004B8E66 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; 96F3F73B1F5711F1003E2D2C /* MGLUserLocationHeadingIndicator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLUserLocationHeadingIndicator.h; sourceTree = ""; }; + AC0C15F1209D0E3600B65675 /* api_mapbox_cn-geotrust_2018.der */ = {isa = PBXFileReference; lastKnownFileType = file; path = "api_mapbox_cn-geotrust_2018.der"; sourceTree = ""; }; + AC0C15F2209D0E6000B65675 /* api_mapbox_cn-digicert_2018.der */ = {isa = PBXFileReference; lastKnownFileType = file; path = "api_mapbox_cn-digicert_2018.der"; sourceTree = ""; }; AC518DFD201BB55A00EBC820 /* MGLTelemetryConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLTelemetryConfig.h; sourceTree = ""; }; AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLTelemetryConfig.m; sourceTree = ""; }; CA55CD3E202C16AA00CE7095 /* MGLCameraChangeReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCameraChangeReason.h; sourceTree = ""; }; @@ -1479,6 +1485,8 @@ DAC49C5F1CD02BC9009E1AA3 /* Localizable.stringsdict */, DA8933EF1CCD387900E68420 /* strip-frameworks.sh */, 40599F001DEE1B2400182B5D /* api_mapbox_staging.der */, + AC0C15F2209D0E6000B65675 /* api_mapbox_cn-digicert_2018.der */, + AC0C15F1209D0E3600B65675 /* api_mapbox_cn-geotrust_2018.der */, 40599F011DEE1B2400182B5D /* api_mapbox_com-digicert_2016.der */, 40599F021DEE1B2400182B5D /* api_mapbox_com-geotrust_2016.der */, 40EA6BBD1EF4598900FCCDA2 /* api_mapbox_com-digicert_2017.der */, @@ -2225,12 +2233,14 @@ files = ( DA8933BC1CCD2CA100E68420 /* Foundation.strings in Resources */, DA8933A31CCC95B000E68420 /* Localizable.strings in Resources */, + AC0C15F5209D0E7200B65675 /* api_mapbox_cn-digicert_2018.der in Resources */, 960D0C361ECF5AAF008E151F /* Images.xcassets in Resources */, DA8933F01CCD387900E68420 /* strip-frameworks.sh in Resources */, DAC49C5C1CD02BC9009E1AA3 /* Localizable.stringsdict in Resources */, DA8933BF1CCD2CAD00E68420 /* Foundation.stringsdict in Resources */, 40EA6BC11EF4599600FCCDA2 /* api_mapbox_com-digicert_2017.der in Resources */, 408982E91DEE208200754016 /* api_mapbox_staging.der in Resources */, + AC0C15F3209D0E6900B65675 /* api_mapbox_cn-geotrust_2018.der in Resources */, 408982EA1DEE208B00754016 /* api_mapbox_com-digicert_2016.der in Resources */, 40EA6BC31EF4599D00FCCDA2 /* api_mapbox_com-geotrust_2017.der in Resources */, 408982EB1DEE209100754016 /* api_mapbox_com-geotrust_2016.der in Resources */, @@ -2241,6 +2251,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + AC0C15F4209D0E7000B65675 /* api_mapbox_cn-geotrust_2018.der in Resources */, DA8933E01CCD31DF00E68420 /* Localizable.strings in Resources */, DA8933DB1CCD31D400E68420 /* Foundation.strings in Resources */, 960D0C371ECF5AAF008E151F /* Images.xcassets in Resources */, @@ -2250,6 +2261,7 @@ 40599F0C1DEE1B7600182B5D /* api_mapbox_staging.der in Resources */, 40599F0D1DEE1B7A00182B5D /* api_mapbox_com-digicert_2016.der in Resources */, 40599F0E1DEE1B7E00182B5D /* api_mapbox_com-geotrust_2016.der in Resources */, + AC0C15F6209D0E7300B65675 /* api_mapbox_cn-digicert_2018.der in Resources */, 40EA6BC21EF4599700FCCDA2 /* api_mapbox_com-digicert_2017.der in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/platform/ios/resources/api_mapbox_cn-digicert_2018.der b/platform/ios/resources/api_mapbox_cn-digicert_2018.der new file mode 100644 index 0000000000..e458713337 Binary files /dev/null and b/platform/ios/resources/api_mapbox_cn-digicert_2018.der differ diff --git a/platform/ios/resources/api_mapbox_cn-geotrust_2018.der b/platform/ios/resources/api_mapbox_cn-geotrust_2018.der new file mode 100644 index 0000000000..e3d4b222ae Binary files /dev/null and b/platform/ios/resources/api_mapbox_cn-geotrust_2018.der differ diff --git a/platform/ios/src/MGLAPIClient.m b/platform/ios/src/MGLAPIClient.m index 8a987d76d8..68e78835c3 100644 --- a/platform/ios/src/MGLAPIClient.m +++ b/platform/ios/src/MGLAPIClient.m @@ -2,9 +2,11 @@ #import "NSBundle+MGLAdditions.h" #import "NSData+MGLAdditions.h" #import "MGLAccountManager.h" +#import "MGLNetworkConfiguration.h" static NSString * const MGLAPIClientUserAgentBase = @"MapboxEventsiOS"; static NSString * const MGLAPIClientBaseURL = @"https://events.mapbox.com"; +static NSString * const MGLAPIClientChinaBaseURL = @"https://events.mapbox.cn"; static NSString * const MGLAPIClientEventsPath = @"events/v2"; static NSString * const MGLAPIClientHeaderFieldUserAgentKey = @"User-Agent"; @@ -21,6 +23,8 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST"; @property (nonatomic, copy) NSData *geoTrustCert_2016; @property (nonatomic, copy) NSData *digicertCert_2017; @property (nonatomic, copy) NSData *geoTrustCert_2017; +@property (nonatomic, copy) NSData *digicertCert_cn_2018; +@property (nonatomic, copy) NSData *geoTrustCert_cn_2018; @property (nonatomic, copy) NSData *testServerCert; @property (nonatomic, copy) NSString *userAgent; @property (nonatomic) BOOL usesTestServer; @@ -102,6 +106,8 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST"; if (testServerURL && [testServerURL.scheme isEqualToString:@"https"]) { self.baseURL = testServerURL; self.usesTestServer = YES; + } else if ([[[NSBundle mainBundle] objectForInfoDictionaryKey:@"MGLMapboxAPIBaseURL"] isEqualToString:MGLChinaMapboxAPIBaseURL]) { + self.baseURL = [NSURL URLWithString:MGLAPIClientChinaBaseURL]; } else { self.baseURL = [NSURL URLWithString:MGLAPIClientBaseURL]; } @@ -117,6 +123,10 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST"; self.geoTrustCert_2017 = certificate; [self loadCertificate:&certificate withResource:@"api_mapbox_com-digicert_2017"]; self.digicertCert_2017 = certificate; + [self loadCertificate:&certificate withResource:@"api_mapbox_cn-geotrust_2018"]; + self.geoTrustCert_cn_2018 = certificate; + [self loadCertificate:&certificate withResource:@"api_mapbox_cn-digicert_2018"]; + self.digicertCert_cn_2018 = certificate; [self loadCertificate:&certificate withResource:@"api_mapbox_staging"]; self.testServerCert = certificate; } @@ -174,17 +184,23 @@ static NSString * const MGLAPIClientHTTPMethodPost = @"POST"; // Look for a pinned certificate in the server's certificate chain CFIndex numKeys = SecTrustGetCertificateCount(serverTrust); - // Check certs in the following order: digicert 2016, digicert 2017, geotrust 2016, geotrust 2017 + // Check certs in the following order: digicert 2016, digicert 2017, digicert CN 2018, geotrust 2016, geotrust 2017, geotrust CN 2018 found = [self evaluateCertificateWithCertificateData:self.digicertCert_2016 keyCount:numKeys serverTrust:serverTrust challenge:challenge completionHandler:completionHandler]; if (!found) { found = [self evaluateCertificateWithCertificateData:self.digicertCert_2017 keyCount:numKeys serverTrust:serverTrust challenge:challenge completionHandler:completionHandler]; } + if (!found) { + found = [self evaluateCertificateWithCertificateData:self.digicertCert_cn_2018 keyCount:numKeys serverTrust:serverTrust challenge:challenge completionHandler:completionHandler]; + } if (!found) { found = [self evaluateCertificateWithCertificateData:self.geoTrustCert_2016 keyCount:numKeys serverTrust:serverTrust challenge:challenge completionHandler:completionHandler]; } if (!found) { found = [self evaluateCertificateWithCertificateData:self.geoTrustCert_2017 keyCount:numKeys serverTrust:serverTrust challenge:challenge completionHandler:completionHandler]; } + if (!found) { + found = [self evaluateCertificateWithCertificateData:self.geoTrustCert_cn_2018 keyCount:numKeys serverTrust:serverTrust challenge:challenge completionHandler:completionHandler]; + } // If challenge can't be completed with any of the above certs, then try the test server if the app is configured to use the test server if (!found && _usesTestServer) { -- cgit v1.2.1 From 30e8798d768847d821128b3ce8ce348811f53a22 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 7 May 2018 17:07:13 -0400 Subject: [ios] Prepare ios-v3.7.8 release --- platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec index 9d714ccb6a..265331791a 100644 --- a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec +++ b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.7' + version = '3.7.8' m.name = 'Mapbox-iOS-SDK-nightly-dynamic' m.version = "#{version}-nightly" diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index ebf758cbf6..3e3311f912 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.7' + version = '3.7.8' m.name = 'Mapbox-iOS-SDK-symbols' m.version = "#{version}-symbols" diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index d8ac87363b..6eaac7b73b 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '3.7.7' + version = '3.7.8' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1 From ee1008870284d2956c4d246bd8751e032ee91898 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 4 May 2018 14:45:29 -0400 Subject: [ios] Fix MGLAnnotationView.rotatesToMatchCamera clobbering other transforms --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLAnnotationView.mm | 26 ++++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 057149190c..9520a5d24e 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -14,6 +14,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) * Fixed an issue where annotation views could become distorted if `rotatesToMatchCamera` is `YES`. ([#11817](https://github.com/mapbox/mapbox-gl-native/pull/11817)) +* Fixed `MGLAnnotationView.rotatesToMatchCamera` overriding other transforms that might be applied to annotation views that had this property enabled. ([#11842](https://github.com/mapbox/mapbox-gl-native/pull/11842)) ### Other changes diff --git a/platform/ios/src/MGLAnnotationView.mm b/platform/ios/src/MGLAnnotationView.mm index 1c53ba507a..46b0f56a79 100644 --- a/platform/ios/src/MGLAnnotationView.mm +++ b/platform/ios/src/MGLAnnotationView.mm @@ -11,8 +11,9 @@ @property (nonatomic, readwrite, nullable) NSString *reuseIdentifier; @property (nonatomic, readwrite) CATransform3D lastAppliedScaleTransform; -@property (nonatomic, readwrite) CATransform3D lastAppliedRotateTransform; @property (nonatomic, readwrite) CGFloat lastPitch; +@property (nonatomic, readwrite) CATransform3D lastAppliedRotationTransform; +@property (nonatomic, readwrite) CGFloat lastDirection; @property (nonatomic, weak) UIPanGestureRecognizer *panGestureRecognizer; @property (nonatomic, weak) UILongPressGestureRecognizer *longPressRecognizer; @property (nonatomic, weak) MGLMapView *mapView; @@ -43,9 +44,9 @@ - (void)commonInitWithAnnotation:(nullable id)annotation reuseIdentifier:(nullable NSString *)reuseIdentifier { _lastAppliedScaleTransform = CATransform3DIdentity; + _lastAppliedRotationTransform = CATransform3DIdentity; _annotation = annotation; _reuseIdentifier = [reuseIdentifier copy]; - _scalesWithViewingDistance = NO; _enabled = YES; } @@ -159,7 +160,7 @@ // We keep track of each viewing distance scale transform that we apply. Each iteration, // we can account for it so that we don't get cumulative scaling every time we move. - // We also avoid clobbering any existing transform passed in by the client, too. + // We also avoid clobbering any existing transform passed in by the client or this SDK. CATransform3D undoOfLastScaleTransform = CATransform3DInvert(_lastAppliedScaleTransform); CATransform3D newScaleTransform = CATransform3DMakeScale(pitchAdjustedScale, pitchAdjustedScale, 1); CATransform3D effectiveTransform = CATransform3DConcat(undoOfLastScaleTransform, newScaleTransform); @@ -181,11 +182,20 @@ { if (self.rotatesToMatchCamera == NO) return; - CGFloat directionRad = self.mapView.direction * M_PI / 180.0; - CATransform3D newRotateTransform = CATransform3DMakeRotation(-directionRad, 0, 0, 1); - self.layer.transform = CATransform3DConcat(CATransform3DIdentity, newRotateTransform); - - _lastAppliedRotateTransform = newRotateTransform; + CGFloat direction = -MGLRadiansFromDegrees(self.mapView.direction); + + // Return early if the map view has the same rotation as the already-applied transform. + if (direction == _lastDirection) return; + _lastDirection = direction; + + // We keep track of each rotation transform that we apply. Each iteration, + // we can account for it so that we don't get cumulative rotation every time we move. + // We also avoid clobbering any existing transform passed in by the client or this SDK. + CATransform3D undoOfLastRotationTransform = CATransform3DInvert(_lastAppliedRotationTransform); + CATransform3D newRotationTransform = CATransform3DMakeRotation(direction, 0, 0, 1); + CATransform3D effectiveTransform = CATransform3DConcat(undoOfLastRotationTransform, newRotationTransform); + self.layer.transform = CATransform3DConcat(self.layer.transform, effectiveTransform); + _lastAppliedRotationTransform = newRotationTransform; } #pragma mark - Draggable -- cgit v1.2.1 From 0d067e39253813b07c421a1c0a21c57a775fd8ec Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 11 May 2018 16:02:48 -0400 Subject: [ios, build] Re-add support for 32-bit simulators (i386) --- platform/ios/CHANGELOG.md | 6 +++++- platform/ios/INSTALL.md | 2 +- platform/ios/scripts/package.sh | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 9520a5d24e..7bf8f17389 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -4,10 +4,14 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ## 4.0.1 +### Packaging + +* Re-added support for 32-bit simulators (i386) to work around an issue in CocoaPods. ([#11891](https://github.com/mapbox/mapbox-gl-native/pull/11891)) + ### Style layers * Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) -* Added `FISRT`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770)) +* Added `FIRST`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770)) ### Annotations diff --git a/platform/ios/INSTALL.md b/platform/ios/INSTALL.md index 01f4621b1e..9c46e7fbe0 100644 --- a/platform/ios/INSTALL.md +++ b/platform/ios/INSTALL.md @@ -12,7 +12,7 @@ The Mapbox Maps SDK for iOS is intended to run on iOS 8.0 and above on the follo _Note: Support for iOS 8 will be removed in a future release and the minimum iOS deployment version will increase to iOS 9.0._ -Note that 32-bit simulators (such as the iPhone 5 or iPad 2) are not supported. +Note that debugging in 32-bit simulators (such as the iPhone 5 or iPad 2) is only partially supported. The Mapbox Maps SDK for iOS requires: diff --git a/platform/ios/scripts/package.sh b/platform/ios/scripts/package.sh index 6df1b687b4..438fce240f 100755 --- a/platform/ios/scripts/package.sh +++ b/platform/ios/scripts/package.sh @@ -70,7 +70,7 @@ xcodebuild \ CURRENT_SHORT_VERSION=${SHORT_VERSION} \ CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \ CURRENT_COMMIT_HASH=${HASH} \ - ARCHS="x86_64" \ + ONLY_ACTIVE_ARCH=NO \ -derivedDataPath ${DERIVED_DATA} \ -workspace ./platform/ios/ios.xcworkspace \ -scheme ${SCHEME} \ @@ -194,6 +194,10 @@ if [[ ${BUILD_DYNAMIC} == true && ${BUILDTYPE} == Release ]]; then validate_dsym \ "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" \ "${OUTPUT}/dynamic/${NAME}.framework/${NAME}" + + step "Removing i386 slice from dSYM" + lipo -remove i386 "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" -o "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" + lipo -info "${OUTPUT}/dynamic/${NAME}.framework.dSYM/Contents/Resources/DWARF/${NAME}" fi function create_podspec { -- cgit v1.2.1 From 4b1530ff422d9ba77ddb9ef34d64c2e04f356380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 14 May 2018 12:18:13 -0700 Subject: =?UTF-8?q?[core]=20Convert=20null=20to=20empty=20string,=20not=20?= =?UTF-8?q?=E2=80=9Cnull=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/ios/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 7bf8f17389..99da024ee1 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -12,7 +12,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) * Added `FIRST`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770)) - +* Inside an expression, casting `nil` to a string turns it into the empty string instead of the string `"null"`. ([#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904)) ### Annotations -- cgit v1.2.1 From baf5fd7d01c3618e415389c9dca05886e00ff307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 14 May 2018 13:38:32 -0700 Subject: [ios, macos] Fixed English priority during label localization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Respect English in the Preferred Languages setting even if other Mapbox Streets source–supported languages are listed too. --- platform/ios/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 99da024ee1..136b7634b7 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -23,6 +23,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Other changes * Added a Korean localization. ([#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792)) +* If English is the first language listed in the user’s Preferred Languages setting, `-[MGLStyle localizeLabelsIntoLocale:]` no longer prioritizes other languages over English. ([#11907](https://github.com/mapbox/mapbox-gl-native/pull/11907)) * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) * Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) * Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) -- cgit v1.2.1 From 8383ef4eaeb601ca2280d36f5ecfe0f35d0d013e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 14 May 2018 12:18:13 -0700 Subject: [ios] Copyedit changelog for ios-v4.0.1 --- platform/ios/CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 136b7634b7..400e220473 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,30 +2,30 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. -## 4.0.1 +## 4.0.1 - May 14, 2018 ### Packaging * Re-added support for 32-bit simulators (i386) to work around an issue in CocoaPods. ([#11891](https://github.com/mapbox/mapbox-gl-native/pull/11891)) +* Added a Korean localization. ([#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792)) ### Style layers -* Deprecated `+[NSExpression featurePropertiesVariableExpression]` use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) +* Deprecated `+[NSExpression featurePropertiesVariableExpression]`; use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) * Added `FIRST`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770)) * Inside an expression, casting `nil` to a string turns it into the empty string instead of the string `"null"`. ([#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904)) ### Annotations * Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) -* Fixed an issue where annotation views could become distorted if `rotatesToMatchCamera` is `YES`. ([#11817](https://github.com/mapbox/mapbox-gl-native/pull/11817)) +* Fixed an issue where annotation views could become distorted if `rotatesToMatchCamera` was enabled. ([#11817](https://github.com/mapbox/mapbox-gl-native/pull/11817)) * Fixed `MGLAnnotationView.rotatesToMatchCamera` overriding other transforms that might be applied to annotation views that had this property enabled. ([#11842](https://github.com/mapbox/mapbox-gl-native/pull/11842)) ### Other changes -* Added a Korean localization. ([#11792](https://github.com/mapbox/mapbox-gl-native/pull/11792)) * If English is the first language listed in the user’s Preferred Languages setting, `-[MGLStyle localizeLabelsIntoLocale:]` no longer prioritizes other languages over English. ([#11907](https://github.com/mapbox/mapbox-gl-native/pull/11907)) * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) -* Reduce per-frame render CPU time ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) +* Reduced per-frame render CPU time. ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) * Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) * Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) * Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725)) -- cgit v1.2.1 From 76b66b14096ff1baf99c705fea940a516b7bcd85 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 14 May 2018 15:30:44 -0400 Subject: Add v3.7.7 & v3.7.8 sections to changelog --- platform/ios/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 400e220473..84b4c2e0c6 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -30,6 +30,14 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) * Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725)) +## 3.7.8 - May 7, 2018 + +* Improved compatibility with Mapbox China APIs. ([#11845](https://github.com/mapbox/mapbox-gl-native/pull/11845)) + +## 3.7.7 - May 3, 2018 + +* Fixed a crash when removing an `MGLOfflinePack`. ([#11821](https://github.com/mapbox/mapbox-gl-native/issues/11821)) + ## 4.0.0 - April 19, 2018 The 4.0._x_ series of releases will be the last to support iOS 8. The minimum iOS deployment version will increase to iOS 9.0 in a future release. -- cgit v1.2.1 From d8976456003c2924e15b08888a08435630ab10d6 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 14 May 2018 15:31:26 -0400 Subject: [ios] Prepare ios-v4.0.1 release --- platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec index 7ea1b993ef..83b7bc51f9 100644 --- a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec +++ b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '4.0.0' + version = '4.0.1' m.name = 'Mapbox-iOS-SDK-nightly-dynamic' m.version = "#{version}-nightly" diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 47a021598f..05694e5b6f 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '4.0.0' + version = '4.0.1' m.name = 'Mapbox-iOS-SDK-symbols' m.version = "#{version}-symbols" diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 73412890c8..3fa57839b6 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '4.0.0' + version = '4.0.1' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1 From c0191535eba64813baff7141a33343c9893360cc Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 14 May 2018 15:45:22 -0400 Subject: Remove changelog entry for crash fixed in v3.7.7 --- platform/ios/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 84b4c2e0c6..be17b7c20d 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -26,7 +26,6 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * If English is the first language listed in the user’s Preferred Languages setting, `-[MGLStyle localizeLabelsIntoLocale:]` no longer prioritizes other languages over English. ([#11907](https://github.com/mapbox/mapbox-gl-native/pull/11907)) * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) * Reduced per-frame render CPU time. ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) -* Fixed a crash when removing an `MGLOfflinePack`. ([#6092](https://github.com/mapbox/mapbox-gl-native/issues/6092)) * Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) * Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725)) -- cgit v1.2.1 From 87e3c2571ab76e1f94f8ffe90ce41fa641978647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Tue, 15 May 2018 12:47:22 -0700 Subject: [ios, macos] Copyedited changelogs --- platform/ios/CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index be17b7c20d..35df4cb98d 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -12,22 +12,23 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Style layers * Deprecated `+[NSExpression featurePropertiesVariableExpression]`; use `+[NSExpression featureAttributesVariableExpression]` instead. ([#11748](https://github.com/mapbox/mapbox-gl-native/pull/11748)) +* Added an `-[NSPredicate(MGLAdditions) predicateWithMGLJSONObject:]` method and `NSPredicate.mgl_jsonExpressionObject` property. ([#11810](https://github.com/mapbox/mapbox-gl-native/pull/11810)) * Added `FIRST`, `LAST`, and `SIZE` symbolic array subscripting support to expressions. ([#11770](https://github.com/mapbox/mapbox-gl-native/pull/11770)) * Inside an expression, casting `nil` to a string turns it into the empty string instead of the string `"null"`. ([#11904](https://github.com/mapbox/mapbox-gl-native/pull/11904)) +* Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725)) ### Annotations * Fixed an issue where selecting an onscreen annotation could move the map unintentionally. ([#11731](https://github.com/mapbox/mapbox-gl-native/pull/11731)) * Fixed an issue where annotation views could become distorted if `rotatesToMatchCamera` was enabled. ([#11817](https://github.com/mapbox/mapbox-gl-native/pull/11817)) * Fixed `MGLAnnotationView.rotatesToMatchCamera` overriding other transforms that might be applied to annotation views that had this property enabled. ([#11842](https://github.com/mapbox/mapbox-gl-native/pull/11842)) +* Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) ### Other changes * If English is the first language listed in the user’s Preferred Languages setting, `-[MGLStyle localizeLabelsIntoLocale:]` no longer prioritizes other languages over English. ([#11907](https://github.com/mapbox/mapbox-gl-native/pull/11907)) * Fixed an issue where `-[MGLMapView metersPerPixelAtLatitude:]` was removed, but not marked as unavailable. ([#11765](https://github.com/mapbox/mapbox-gl-native/pull/11765)) * Reduced per-frame render CPU time. ([#11811](https://github.com/mapbox/mapbox-gl-native/issues/11811)) -* Fixed an issue where an `MGLOverlay` object straddling the antimeridian had an empty `MGLOverlay.overlayBounds` value. ([#11783](https://github.com/mapbox/mapbox-gl-native/pull/11783)) -* Fixed an issue where certain colors were being misrepresented in `NSExpression` obtained from `MGLStyleLayer` getters. ([#11725](https://github.com/mapbox/mapbox-gl-native/pull/11725)) ## 3.7.8 - May 7, 2018 -- cgit v1.2.1 From 1aa5c67837a19d5f8ba8f7336f183da83e68441c Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Thu, 17 May 2018 14:47:01 -0400 Subject: [ios, macos] Support array values in match expressions. (#11866) * [ios, macos] Support array values in match expressions. * [ios, macos] Update mgl_match documentation. * [ios, macos] Update changelogs. * [ios, macos] Clarify match expressions documentation. --- platform/ios/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index f70330300b..27ade8b4b0 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -8,6 +8,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * The minimum deployment target for this SDK is now iOS 9.0. ([#11776](https://github.com/mapbox/mapbox-gl-native/pull/11776)) +### Style layers + +* Added support for aggregate expressions as input values to `MGL_MATCH` expressions. ([#11866](https://github.com/mapbox/mapbox-gl-native/pull/11866)) + ## 4.0.1 - May 14, 2018 ### Packaging -- cgit v1.2.1 From be6e40eb683082cb0f3c330179ed59c92a9398aa Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Fri, 18 May 2018 10:14:38 -0400 Subject: [ios] Bump podspect to 4.1.0-alpha.1. (#11937) --- platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec | 2 +- platform/ios/Mapbox-iOS-SDK-symbols.podspec | 2 +- platform/ios/Mapbox-iOS-SDK.podspec | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec index 77ff15ab42..f2d8cee025 100644 --- a/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec +++ b/platform/ios/Mapbox-iOS-SDK-nightly-dynamic.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '4.0.1' + version = '4.1.0-alpha.1' m.name = 'Mapbox-iOS-SDK-nightly-dynamic' m.version = "#{version}-nightly" diff --git a/platform/ios/Mapbox-iOS-SDK-symbols.podspec b/platform/ios/Mapbox-iOS-SDK-symbols.podspec index 7db87e1f08..7f4f27301e 100644 --- a/platform/ios/Mapbox-iOS-SDK-symbols.podspec +++ b/platform/ios/Mapbox-iOS-SDK-symbols.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '4.0.1' + version = '4.1.0-alpha.1' m.name = 'Mapbox-iOS-SDK-symbols' m.version = "#{version}-symbols" diff --git a/platform/ios/Mapbox-iOS-SDK.podspec b/platform/ios/Mapbox-iOS-SDK.podspec index 67e1665853..79229c5e8e 100644 --- a/platform/ios/Mapbox-iOS-SDK.podspec +++ b/platform/ios/Mapbox-iOS-SDK.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |m| - version = '4.0.1' + version = '4.1.0-alpha.1' m.name = 'Mapbox-iOS-SDK' m.version = version -- cgit v1.2.1 From a84ac4c8d79952fa3031f5414b10a560fdef2e1d Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 18 May 2018 15:02:26 -0700 Subject: [core] Align URL token replacement behavior with GL JS I.e. preserve unknown tokens in URLs rather than replacing them with an empty string. --- platform/ios/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 27ade8b4b0..ef89b20c43 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -12,6 +12,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Added support for aggregate expressions as input values to `MGL_MATCH` expressions. ([#11866](https://github.com/mapbox/mapbox-gl-native/pull/11866)) +### Other changes + +* Unknown tokens in URLs are now preserved, rather than replaced with an empty string. ([#11787](https://github.com/mapbox/mapbox-gl-native/issues/11787)) + ## 4.0.1 - May 14, 2018 ### Packaging -- cgit v1.2.1 From bef2a7ccb6e800d2ca6f2bac5c863b49fbba103d Mon Sep 17 00:00:00 2001 From: Julian Rex Date: Mon, 21 May 2018 14:14:58 -0400 Subject: [ios,macos] Fix for infinite loop crash when setting shape to nil in MGLMapViewDelegate methods (#11614) --- platform/ios/CHANGELOG.md | 1 + .../Integration Tests/MGLCameraTransitionTests.mm | 398 +++++++++++++++++++++ .../Integration Tests/MGLMapViewIntegrationTest.h | 13 +- .../Integration Tests/MGLMapViewIntegrationTest.m | 12 +- .../ios/Integration Tests/MGLShapeSourceTests.m | 126 +++++++ platform/ios/ios.xcodeproj/project.pbxproj | 12 + platform/ios/src/MGLCameraChangeReason.h | 6 +- platform/ios/src/MGLMapView.mm | 34 +- 8 files changed, 580 insertions(+), 22 deletions(-) create mode 100644 platform/ios/Integration Tests/MGLCameraTransitionTests.mm create mode 100644 platform/ios/Integration Tests/MGLShapeSourceTests.m (limited to 'platform/ios') diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index ef89b20c43..609bf5f606 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -15,6 +15,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### Other changes * Unknown tokens in URLs are now preserved, rather than replaced with an empty string. ([#11787](https://github.com/mapbox/mapbox-gl-native/issues/11787)) +* Adjusted when and how the camera transition update and finish callbacks are called, fixing recursion bugs. ([#11614](https://github.com/mapbox/mapbox-gl-native/pull/11614)) ## 4.0.1 - May 14, 2018 diff --git a/platform/ios/Integration Tests/MGLCameraTransitionTests.mm b/platform/ios/Integration Tests/MGLCameraTransitionTests.mm new file mode 100644 index 0000000000..d5c288fbb9 --- /dev/null +++ b/platform/ios/Integration Tests/MGLCameraTransitionTests.mm @@ -0,0 +1,398 @@ +#import "MGLMapViewIntegrationTest.h" +#import "../../darwin/src/MGLGeometry_Private.h" + +@interface MBCameraTransitionTests : MGLMapViewIntegrationTest +@end + +@implementation MBCameraTransitionTests + +- (void)testSetAndResetNorthWithDispatchAsyncInDelegateMethod { + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + expectation.expectedFulfillmentCount = 2; + expectation.assertForOverFulfill = YES; + + __weak typeof(self) weakself = self; + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + + MBCameraTransitionTests *strongSelf = weakself; + + if (!strongSelf) return; + + [expectation fulfill]; + + MGLTestAssert(strongSelf, mapView.userTrackingMode != MGLUserTrackingModeFollowWithHeading); + if (mapView.direction != 0.0) { + dispatch_async(dispatch_get_main_queue(), ^{ + [mapView resetNorth]; + }); + } + }; + + [self.mapView setDirection:90 animated:YES]; + + // loop, render, and wait + [self waitForExpectations:@[expectation] timeout:1.5]; +} + + +- (void)testSetAndResetNorthInDelegateMethod { + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + expectation.expectedFulfillmentCount = 2; + expectation.assertForOverFulfill = YES; + + __weak typeof(self) weakself = self; + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + + MBCameraTransitionTests *strongSelf = weakself; + + if (!strongSelf) return; + + [expectation fulfill]; + + MGLTestAssert(strongSelf, mapView.userTrackingMode != MGLUserTrackingModeFollowWithHeading); + if (mapView.direction != 0.0) { + NSLog(@"Reset to north"); + [mapView resetNorth]; + } + }; + + [self.mapView setDirection:90 animated:YES]; + [self waitForExpectations:@[expectation] timeout:1.5]; +} + +- (void)testInterruptingAndResetNorthOnlyOnceInIsChanging { + + // Reset to non-zero, prior to testing + [self.mapView setDirection:45 animated:NO]; + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + expectation.expectedFulfillmentCount = 1; + expectation.assertForOverFulfill = YES; + + __weak typeof(self) weakself = self; + __block BOOL startedReset = NO; + __block BOOL finishedReset = NO; + + self.regionIsChanging = ^(MGLMapView *mapView) { + MBCameraTransitionTests *strongSelf = weakself; + if (!strongSelf) return; + + if (!startedReset) { + NSLog(@"Reset to north, interrupting the previous transition"); + startedReset = YES; + [mapView resetNorth]; + finishedReset = YES; + } + }; + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + MBCameraTransitionTests *strongSelf = weakself; + if (!strongSelf) return; + + MGLTestAssert(strongSelf, startedReset); + + if (finishedReset) { + MGLTestAssert(strongSelf, !(reason & MGLCameraChangeReasonTransitionCancelled)); + [expectation fulfill]; + } + else { + MGLTestAssert(strongSelf, reason & MGLCameraChangeReasonTransitionCancelled); + } + }; + + [self.mapView setDirection:90 animated:YES]; + [self waitForExpectations:@[expectation] timeout:1.5]; + + XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction); +} + +- (void)testSetCenterCancelsTransitions { + XCTestExpectation *cameraIsInDCExpectation = [self expectationWithDescription:@"camera reset to DC"]; + + CLLocationCoordinate2D dc = CLLocationCoordinate2DMake(38.894368, -77.036487); + CLLocationCoordinate2D dc_west = CLLocationCoordinate2DMake(38.894368, -77.076487); + + double zoomLevel = 15.0; + + [self.mapView setCenterCoordinate:dc zoomLevel:zoomLevel animated:NO]; + [self.mapView setCenterCoordinate:dc_west zoomLevel:zoomLevel animated:YES]; + + __weak typeof(self) weakself = self; + + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.15 * NSEC_PER_SEC), + dispatch_get_main_queue(), + ^{ + MBCameraTransitionTests *strongSelf = weakself; + + [strongSelf.mapView setCenterCoordinate:dc zoomLevel:zoomLevel animated:NO]; + MGLTestAssertEqualWithAccuracy(strongSelf, + dc.latitude, + strongSelf.mapView.centerCoordinate.latitude, + 0.0005, + @"setting center coordinate should cancel transitions"); + MGLTestAssertEqualWithAccuracy(strongSelf, + dc.longitude, + strongSelf.mapView.centerCoordinate.longitude, + 0.0005, + @"setting center coordinate should cancel transitions"); + [cameraIsInDCExpectation fulfill]; + }); + + [self waitForExpectations:@[cameraIsInDCExpectation] timeout:10.0]; +} + +- (void)testSetCenterCoordinateInDelegateMethod { + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + expectation.expectedFulfillmentCount = 2; + expectation.assertForOverFulfill = YES; + + __weak typeof(self) weakself = self; + __block NSInteger delegateCallCount = 0; + + CLLocationCoordinate2D target = CLLocationCoordinate2DMake(40.0, 40.0); + CLLocationCoordinate2D target2 = CLLocationCoordinate2DMake(-40.0, -40.0); + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + + MBCameraTransitionTests *strongSelf = weakself; + + if (!strongSelf) return; + + MGLTestAssert(strongSelf, mapView.userTrackingMode != MGLUserTrackingModeFollowWithHeading); + + CLLocationCoordinate2D center = mapView.centerCoordinate; + + switch(delegateCallCount) { + case 0: + { + // Our center coordinate should match our target (assuming we're not + // constrained by zoom level) + MGLTestAssertEqualWithAccuracy(strongSelf, + target.longitude, + center.longitude, + 0.0005, + @"center coordinate longitude should be at target"); + + MGLTestAssertEqualWithAccuracy(strongSelf, + target.latitude, + center.latitude, + 0.0005, + @"center coordinate latitude should be at target"); + + // Now set another coordinate. + // Should take MGLAnimationDuration seconds (0.3s) + [mapView setCenterCoordinate:target2 animated:YES]; + break; + } + + case 1: + { + // Our center coordinate should match our target (assuming we're not + // constrained by zoom level) + MGLTestAssertEqualWithAccuracy(strongSelf, + target2.longitude, + center.longitude, + 0.0005, + @"center coordinate longitude should be at target2"); + + MGLTestAssertEqualWithAccuracy(strongSelf, + target2.latitude, + center.latitude, + 0.0005, + @"center coordinate latitude should be at target2"); + break; + + } + + default: + MGLTestFail(strongSelf); + break; + } + + delegateCallCount++; + + [expectation fulfill]; + }; + + // Should take MGLAnimationDuration seconds (0.3) + [self.mapView setCenterCoordinate:target zoomLevel:15.0 animated:YES]; + [self waitForExpectations:@[expectation] timeout:1.5]; +} + +- (void)testFlyToCameraInDelegateMethod { + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + + __weak typeof(self) weakself = self; + __block NSInteger delegateCallCount = 0; + expectation.expectedFulfillmentCount = 3; + expectation.assertForOverFulfill = YES; + + CLLocationCoordinate2D target = CLLocationCoordinate2DMake(40.0, 40.0); + CLLocationCoordinate2D target2 = CLLocationCoordinate2DMake(30.0, 30.0); + + __block BOOL runloop = YES; + + NSTimeInterval stop0 = CACurrentMediaTime(); + __block NSTimeInterval stop1 = 0.0; + __block NSTimeInterval stop2 = 0.0; + + double zoomLevel = 5.0; + double altitude = MGLAltitudeForZoomLevel(zoomLevel, 0.0, target.latitude, self.mapView.frame.size); + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + + MBCameraTransitionTests *strongSelf = weakself; + + if (!strongSelf) return; + + MGLTestAssert(strongSelf, mapView.userTrackingMode != MGLUserTrackingModeFollowWithHeading); + + CLLocationCoordinate2D center = mapView.centerCoordinate; + + switch(delegateCallCount) { + case 0: + { + stop1 = CACurrentMediaTime(); + + // Our center coordinate should match our target (assuming we're not + // constrained by zoom level) + MGLTestAssertEqualWithAccuracy(strongSelf, + target.longitude, + center.longitude, + 0.0005, + @"center coordinate longitude should be at target"); + + MGLTestAssertEqualWithAccuracy(strongSelf, + target.latitude, + center.latitude, + 0.0005, + @"center coordinate latitude should be at target"); + + // Now set another coordinate. + MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:target2 + fromDistance:altitude + pitch:0.0 + heading:0.0]; + + // flyToCamera can take a while... + [mapView flyToCamera:camera completionHandler:^{ + MGLTestAssert(strongSelf, !runloop, @"Completion block should be called after delegate method"); + [expectation fulfill]; + stop2 = CACurrentMediaTime(); + }]; + break; + } + + case 1: + { + // Our center coordinate should match our target (assuming we're not + // constrained by zoom level) + MGLTestAssertEqualWithAccuracy(strongSelf, + target2.longitude, + center.longitude, + 0.0005, + @"center coordinate longitude should be at target2"); + + MGLTestAssertEqualWithAccuracy(strongSelf, + target2.latitude, + center.latitude, + 0.0005, + @"center coordinate latitude should be at target2"); + + runloop = NO; + break; + } + + default: + MGLTestFail(strongSelf); + break; + } + + delegateCallCount++; + + [expectation fulfill]; + }; + + // Should take MGLAnimationDuration + [self.mapView setCenterCoordinate:target zoomLevel:zoomLevel animated:YES]; + + // Run the loop, so the camera can fly to the new camera + while (runloop) { + [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; + } + [self waitForExpectations:@[expectation] timeout:0.5]; + + NSLog(@"setCenterCoordinate: %0.4fs", stop1 - stop0); + NSLog(@"flyToCamera: %0.4fs", stop2 - stop1); + + XCTAssert(delegateCallCount == 2, @"Expecting 2 regionDidChange callbacks, got %ld", delegateCallCount); // Once for the setDirection and once for the reset north +} + +#pragma mark - Pending tests + +- (void)disabled_testContinuallyResettingNorthInIsChangingPENDING { + + // See https://github.com/mapbox/mapbox-gl-native/pull/11614 + // This test currently fails, unsurprisingly, since we're continually + // setting the camera to the same parameters during its update. + // + // Possible solutions/expectations: + // - If you set camera parameters that match the *current* target parameters + // then the transition could be a no-op. We'd need to consider any completion + // block + // - Ideally we would detect this case and disallow it. + + // Reset to non-zero, prior to testing + [self.mapView setDirection:45 animated:NO]; + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + expectation.expectedFulfillmentCount = 2; + expectation.assertForOverFulfill = YES; + + self.regionIsChanging = ^(MGLMapView *mapView) { + [mapView resetNorth]; + }; + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + [expectation fulfill]; + }; + + [self.mapView setDirection:90 animated:YES]; + [self waitForExpectations:@[expectation] timeout:1.5]; + + XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction); +} + +- (void)disabled_testContinuallySettingCoordinateInIsChangingPENDING { + // See above comment in `-disabled_testContinuallyResettingNorthInIsChangingPENDING` + + // Reset to non-zero, prior to testing + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(0.0, 0.0) animated:NO]; + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + expectation.expectedFulfillmentCount = 2; + expectation.assertForOverFulfill = YES; + + __weak typeof(self) weakself = self; + + self.regionIsChanging = ^(MGLMapView *mapView) { + [weakself.mapView setCenterCoordinate:CLLocationCoordinate2DMake(-40.0, -40.0) animated:YES]; + }; + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + [expectation fulfill]; + }; + + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(40.0, 40.0) animated:YES]; + [self waitForExpectations:@[expectation] timeout:1.5]; + + XCTAssertEqualWithAccuracy(self.mapView.direction, 0.0, 0.001, @"Camera should have reset to north. %0.3f", self.mapView.direction); +} + +@end diff --git a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h index ab5d2cc46f..6c04ed9f84 100644 --- a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h +++ b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.h @@ -1,18 +1,23 @@ #import #import -#define TestFailWithSelf(myself, ...) \ +#define MGLTestFail(myself, ...) \ _XCTPrimitiveFail(myself, __VA_ARGS__) +#define MGLTestAssert(myself, expression, ...) \ + _XCTPrimitiveAssertTrue(myself, expression, @#expression, __VA_ARGS__) + +#define MGLTestAssertEqualWithAccuracy(myself, expression1, expression2, accuracy, ...) \ + _XCTPrimitiveAssertEqualWithAccuracy(myself, expression1, @#expression1, expression2, @#expression2, accuracy, @#accuracy, __VA_ARGS__) + @interface MGLMapViewIntegrationTest : XCTestCase @property (nonatomic) MGLMapView *mapView; @property (nonatomic) MGLStyle *style; @property (nonatomic) XCTestExpectation *styleLoadingExpectation; @property (nonatomic) XCTestExpectation *renderFinishedExpectation; -@property (nonatomic) void (^regionDidChange)(MGLMapView *mapView, BOOL animated); +@property (nonatomic) void (^regionWillChange)(MGLMapView *mapView, BOOL animated); @property (nonatomic) void (^regionIsChanging)(MGLMapView *mapView); - - +@property (nonatomic) void (^regionDidChange)(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated); // Utility methods - (void)waitForMapViewToFinishLoadingStyleWithTimeout:(NSTimeInterval)timeout; diff --git a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m index fc3229c83b..c42b8eef89 100644 --- a/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m +++ b/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m @@ -45,9 +45,9 @@ self.renderFinishedExpectation = nil; } -- (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated { - if (self.regionDidChange) { - self.regionDidChange(mapView, animated); +- (void)mapView:(MGLMapView *)mapView regionWillChangeAnimated:(BOOL)animated { + if (self.regionWillChange) { + self.regionWillChange(mapView, animated); } } @@ -57,6 +57,12 @@ } } +- (void)mapView:(MGLMapView *)mapView regionDidChangeWithReason:(MGLCameraChangeReason)reason animated:(BOOL)animated { + if (self.regionDidChange) { + self.regionDidChange(mapView, reason, animated); + } +} + #pragma mark - Utilities - (void)waitForMapViewToFinishLoadingStyleWithTimeout:(NSTimeInterval)timeout { diff --git a/platform/ios/Integration Tests/MGLShapeSourceTests.m b/platform/ios/Integration Tests/MGLShapeSourceTests.m new file mode 100644 index 0000000000..088a9b011e --- /dev/null +++ b/platform/ios/Integration Tests/MGLShapeSourceTests.m @@ -0,0 +1,126 @@ +// +// MBShapeSourceTests.m +// integration +// +// Created by Julian Rex on 4/5/18. +// Copyright © 2018 Mapbox. All rights reserved. +// + +#import "MGLMapViewIntegrationTest.h" + +@interface MGLShapeSourceTests : MGLMapViewIntegrationTest +@end + +@implementation MGLShapeSourceTests + +- (void)testSettingShapeSourceToNilInRegionDidChange { + + NSMutableArray *features = [[NSMutableArray alloc] init]; + + for (NSUInteger i = 0; i <= 180; i+=5) { + CLLocationCoordinate2D coord[4] = { + CLLocationCoordinate2DMake(round(0), round(i)), + CLLocationCoordinate2DMake(round(20), round(i)), + CLLocationCoordinate2DMake(round(0), round(i / 2 )), + CLLocationCoordinate2DMake(round(20), round(i / 2))}; + + MGLPolygonFeature *feature = [MGLPolygonFeature polygonWithCoordinates:coord count:4]; + [features addObject:feature]; + } + + MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"source" features:features options:nil]; + [self.style addSource:shapeSource]; + + MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layer" source:shapeSource]; + layer.fillOpacity = [NSExpression expressionForConstantValue:@0.5]; + [self.style addLayer:layer]; + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + expectation.expectedFulfillmentCount = 1; + expectation.assertForOverFulfill = YES; + + __weak typeof(self) weakself = self; + __block NSInteger delegateCallCount = 0; + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + + MGLShapeSourceTests *strongSelf = weakself; + + if (!strongSelf) + return; + + delegateCallCount++; + + // Setting the shapeSource.shape = nil, was causing an infinite loop, so here + // we check for a runaway call. 10 here is arbitrary. We could argue that this + // should check that the call count is only 1, however in this case we particularly + // want to check for the infinite loop. + // See https://github.com/mapbox/mapbox-gl-native/issues/11180 + + if (delegateCallCount > 10) { + MGLTestFail(strongSelf); + } + else { + shapeSource.shape = nil; + } + + [expectation fulfill]; + }; + + // setCenterCoordinate is NOT animated here. + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(10.0, 10.0)]; + [self waitForExpectations:@[expectation] timeout:5.0]; +} + +- (void)testSettingShapeSourceToNilInRegionIsChanging { + + NSMutableArray *features = [[NSMutableArray alloc] init]; + + for (NSUInteger i = 0; i <= 180; i+=5) { + CLLocationCoordinate2D coord[4] = { + CLLocationCoordinate2DMake(round(0), round(i)), + CLLocationCoordinate2DMake(round(20), round(i)), + CLLocationCoordinate2DMake(round(0), round(i / 2 )), + CLLocationCoordinate2DMake(round(20), round(i / 2))}; + + MGLPolygonFeature *feature = [MGLPolygonFeature polygonWithCoordinates:coord count:4]; + [features addObject:feature]; + } + + MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"source" features:features options:nil]; + [self.style addSource:shapeSource]; + + MGLFillStyleLayer *layer = [[MGLFillStyleLayer alloc] initWithIdentifier:@"layer" source:shapeSource]; + layer.fillOpacity = [NSExpression expressionForConstantValue:@0.5]; + [self.style addLayer:layer]; + + XCTestExpectation *expectation = [self expectationWithDescription:@"regionDidChange expectation"]; + expectation.expectedFulfillmentCount = 1; + expectation.assertForOverFulfill = YES; + + __block NSInteger delegateCallCount = 0; + __weak typeof(self) weakself = self; + + self.regionIsChanging = ^(MGLMapView *mapView) { + // See https://github.com/mapbox/mapbox-gl-native/issues/11180 + shapeSource.shape = nil; + }; + + self.regionDidChange = ^(MGLMapView *mapView, MGLCameraChangeReason reason, BOOL animated) { + + delegateCallCount++; + + if (delegateCallCount > 1) { + MGLTestFail(weakself); + } + + [expectation fulfill]; + }; + + // Should take MGLAnimationDuration seconds (0.3) + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(10.0, 10.0) animated:YES]; + [self waitForExpectations:@[expectation] timeout:1.0]; +} + + +@end diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 78cfff965c..aef2552b0b 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -363,8 +363,10 @@ AC518E00201BB55A00EBC820 /* MGLTelemetryConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = AC518DFD201BB55A00EBC820 /* MGLTelemetryConfig.h */; }; AC518E03201BB56000EBC820 /* MGLTelemetryConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */; }; AC518E04201BB56100EBC820 /* MGLTelemetryConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */; }; + CA0C27922076C804001CE5B7 /* MGLShapeSourceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0C27912076C804001CE5B7 /* MGLShapeSourceTests.m */; }; CA0C27942076CA19001CE5B7 /* MGLMapViewIntegrationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */; }; CA4EB8C720863487006AB465 /* MGLStyleLayerIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA4EB8C620863487006AB465 /* MGLStyleLayerIntegrationTests.m */; }; + CA34C9C3207FD272005C1A06 /* MGLCameraTransitionTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = CA34C9C2207FD272005C1A06 /* MGLCameraTransitionTests.mm */; }; CA55CD41202C16AA00CE7095 /* MGLCameraChangeReason.h in Headers */ = {isa = PBXBuildFile; fileRef = CA55CD3E202C16AA00CE7095 /* MGLCameraChangeReason.h */; settings = {ATTRIBUTES = (Public, ); }; }; CA55CD42202C16AA00CE7095 /* MGLCameraChangeReason.h in Headers */ = {isa = PBXBuildFile; fileRef = CA55CD3E202C16AA00CE7095 /* MGLCameraChangeReason.h */; settings = {ATTRIBUTES = (Public, ); }; }; CAA69DA4206DCD0E007279CD /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4A26961CB6E795000B7809 /* Mapbox.framework */; }; @@ -996,9 +998,11 @@ 96F3F73B1F5711F1003E2D2C /* MGLUserLocationHeadingIndicator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLUserLocationHeadingIndicator.h; sourceTree = ""; }; AC518DFD201BB55A00EBC820 /* MGLTelemetryConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLTelemetryConfig.h; sourceTree = ""; }; AC518DFE201BB55A00EBC820 /* MGLTelemetryConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLTelemetryConfig.m; sourceTree = ""; }; + CA0C27912076C804001CE5B7 /* MGLShapeSourceTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLShapeSourceTests.m; sourceTree = ""; }; CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLMapViewIntegrationTest.m; sourceTree = ""; }; CA0C27952076CA50001CE5B7 /* MGLMapViewIntegrationTest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLMapViewIntegrationTest.h; sourceTree = ""; }; CA4EB8C620863487006AB465 /* MGLStyleLayerIntegrationTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLStyleLayerIntegrationTests.m; sourceTree = ""; }; + CA34C9C2207FD272005C1A06 /* MGLCameraTransitionTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLCameraTransitionTests.mm; sourceTree = ""; }; CA55CD3E202C16AA00CE7095 /* MGLCameraChangeReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLCameraChangeReason.h; sourceTree = ""; }; DA00FC8C1D5EEB0D009AABC8 /* MGLAttributionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLAttributionInfo.h; sourceTree = ""; }; DA00FC8D1D5EEB0D009AABC8 /* MGLAttributionInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLAttributionInfo.mm; sourceTree = ""; }; @@ -1353,6 +1357,8 @@ children = ( 16376B091FFD9DAF0000563E /* MBGLIntegrationTests.m */, 16376B0B1FFD9DAF0000563E /* Info.plist */, + CA34C9C2207FD272005C1A06 /* MGLCameraTransitionTests.mm */, + CA0C27912076C804001CE5B7 /* MGLShapeSourceTests.m */, CA0C27932076CA19001CE5B7 /* MGLMapViewIntegrationTest.m */, CA0C27952076CA50001CE5B7 /* MGLMapViewIntegrationTest.h */, CA4EB8C620863487006AB465 /* MGLStyleLayerIntegrationTests.m */, @@ -2809,8 +2815,10 @@ buildActionMask = 2147483647; files = ( CA4EB8C720863487006AB465 /* MGLStyleLayerIntegrationTests.m in Sources */, + CA34C9C3207FD272005C1A06 /* MGLCameraTransitionTests.mm in Sources */, 16376B0A1FFD9DAF0000563E /* MBGLIntegrationTests.m in Sources */, CA0C27942076CA19001CE5B7 /* MGLMapViewIntegrationTest.m in Sources */, + CA0C27922076C804001CE5B7 /* MGLShapeSourceTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3379,6 +3387,7 @@ /* Begin XCBuildConfiguration section */ 16376B0E1FFD9DAF0000563E /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -3393,6 +3402,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; + HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = "Integration Tests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests"; @@ -3404,6 +3414,7 @@ }; 16376B0F1FFD9DAF0000563E /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 55D8C9941D0F133500F42F10 /* config.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -3418,6 +3429,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; GCC_C_LANGUAGE_STANDARD = gnu11; + HEADER_SEARCH_PATHS = "$(mbgl_core_INCLUDE_DIRECTORIES)"; INFOPLIST_FILE = "Integration Tests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests"; diff --git a/platform/ios/src/MGLCameraChangeReason.h b/platform/ios/src/MGLCameraChangeReason.h index 6c6b3636ba..f439d3e7ea 100644 --- a/platform/ios/src/MGLCameraChangeReason.h +++ b/platform/ios/src/MGLCameraChangeReason.h @@ -57,5 +57,9 @@ typedef NS_OPTIONS(NSUInteger, MGLCameraChangeReason) MGLCameraChangeReasonGestureOneFingerZoom = 1 << 7, // :nodoc: The user panned with two fingers to tilt the map (two finger drag). - MGLCameraChangeReasonGestureTilt = 1 << 8 + MGLCameraChangeReasonGestureTilt = 1 << 8, + + // :nodoc: Cancelled + MGLCameraChangeReasonTransitionCancelled = 1 << 16 + }; diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 26b23abb4e..e16411f2c5 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1271,7 +1271,7 @@ public: { [self setUserTrackingMode:MGLUserTrackingModeNone animated:NO]; } - _mbglMap->cancelTransitions(); + [self cancelTransitions]; } - (void)notifyGestureDidBegin { @@ -1321,7 +1321,7 @@ public: { if ( ! self.isScrollEnabled) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; MGLMapCamera *oldCamera = self.camera; @@ -1390,7 +1390,7 @@ public: { if ( ! self.isZoomEnabled) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; CGPoint centerPoint = [self anchorPointForGesture:pinch]; MGLMapCamera *oldCamera = self.camera; @@ -1491,7 +1491,7 @@ public: { if ( ! self.isRotateEnabled) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; CGPoint centerPoint = [self anchorPointForGesture:rotate]; MGLMapCamera *oldCamera = self.camera; @@ -1696,7 +1696,7 @@ public: { if ( ! self.isZoomEnabled) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; if (doubleTap.state == UIGestureRecognizerStateEnded) { @@ -1737,7 +1737,7 @@ public: if (_mbglMap->getZoom() == _mbglMap->getMinZoom()) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; self.cameraChangeReasonBitmask |= MGLCameraChangeReasonGestureZoomOut; @@ -1776,7 +1776,7 @@ public: { if ( ! self.isZoomEnabled) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; self.cameraChangeReasonBitmask |= MGLCameraChangeReasonGestureOneFingerZoom; @@ -1821,7 +1821,7 @@ public: { if ( ! self.isPitchEnabled) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; self.cameraChangeReasonBitmask |= MGLCameraChangeReasonGestureTilt; @@ -2981,7 +2981,7 @@ public: return; } - _mbglMap->cancelTransitions(); + [self cancelTransitions]; self.cameraChangeReasonBitmask |= MGLCameraChangeReasonProgrammatic; @@ -3006,7 +3006,7 @@ public: - (void)setZoomLevel:(double)zoomLevel animated:(BOOL)animated { if (zoomLevel == self.zoomLevel) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; self.cameraChangeReasonBitmask |= MGLCameraChangeReasonProgrammatic; @@ -3149,7 +3149,7 @@ public: } [self willChangeValueForKey:@"visibleCoordinateBounds"]; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; self.cameraChangeReasonBitmask |= MGLCameraChangeReasonProgrammatic; @@ -3182,7 +3182,7 @@ public: - (void)_setDirection:(CLLocationDirection)direction animated:(BOOL)animated { if (direction == self.direction) return; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; CGFloat duration = animated ? MGLAnimationDuration : 0; @@ -3271,7 +3271,7 @@ public: } [self willChangeValueForKey:@"camera"]; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; self.cameraChangeReasonBitmask |= MGLCameraChangeReasonProgrammatic; @@ -3330,7 +3330,7 @@ public: } [self willChangeValueForKey:@"camera"]; - _mbglMap->cancelTransitions(); + [self cancelTransitions]; self.cameraChangeReasonBitmask |= MGLCameraChangeReasonProgrammatic; @@ -3339,6 +3339,12 @@ public: [self didChangeValueForKey:@"camera"]; } +- (void)cancelTransitions { + self.cameraChangeReasonBitmask |= MGLCameraChangeReasonTransitionCancelled; + _mbglMap->cancelTransitions(); + self.cameraChangeReasonBitmask &= ~MGLCameraChangeReasonTransitionCancelled; +} + - (MGLMapCamera *)cameraThatFitsCoordinateBounds:(MGLCoordinateBounds)bounds { return [self cameraThatFitsCoordinateBounds:bounds edgePadding:UIEdgeInsetsZero]; -- cgit v1.2.1