Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Cherry picks for release 6.2.2 #509

Merged
merged 6 commits into from
Oct 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started.

## 6.2.1 - September 23, 2020
## 6.2.2 - October 19, 2020

### 🐞 Bug fixes

* Partly fixed an issue on iOS 14 where `-[UIView layoutSubviews]` was being repeatedly called. ([#501](https://github.com/mapbox/mapbox-gl-native-ios/pull/501))
* Fixed a bug with UIViews being incorrectly updated with a one frame delay. ([#483](https://github.com/mapbox/mapbox-gl-native-ios/pull/483))
* Fixed an issue on iOS 14 where scalebar triggers unnecessary `-[UIView layoutSubviews]`. ([#507](https://github.com/mapbox/mapbox-gl-native-ios/pull/507))

## 6.2.1 - September 23, 2020

* Fixed an issue where completion blocks were not called until the map was rendered. ([#463](https://github.com/mapbox/mapbox-gl-native-ios/pull/463))
* Fixed an issue that caused a crash when custom location managers did not implement `MGLLocationManager.accuracyAuthorization`. ([#474](https://github.com/mapbox/mapbox-gl-native-ios/pull/474))
* Fixed a crash that occurred when `MGLIdeographicFontFamilyName` was set to `NO`. ([#467](https://github.com/mapbox/mapbox-gl-native-ios/pull/467), [#476](https://github.com/mapbox/mapbox-gl-native-ios/pull/476))
Expand Down
4 changes: 2 additions & 2 deletions platform/ios/Integration Test Harness/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.2.1</string>
<string>6.2.2</string>
<key>CFBundleVersion</key>
<string>15271</string>
<string>15275</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
4 changes: 2 additions & 2 deletions platform/ios/Integration Tests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>6.2.1</string>
<string>6.2.2</string>
<key>CFBundleVersion</key>
<string>15271</string>
<string>15275</string>
</dict>
</plist>
6 changes: 3 additions & 3 deletions platform/ios/Mapbox-iOS-SDK-snapshot-dynamic.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|

version = '6.2.1'
version = '6.2.2'

m.name = 'Mapbox-iOS-SDK-snapshot-dynamic'
m.version = "#{version}-snapshot"
Expand All @@ -10,9 +10,9 @@ Pod::Spec.new do |m|
m.homepage = 'https://docs.mapbox.com/ios/maps/'
m.license = { :type => 'BSD', :file => 'LICENSE.md' }
m.author = { 'Mapbox' => '[email protected]' }
m.screenshot = "https://docs.mapbox.com/ios/api/maps/#{version}/img/screenshot.png"
m.screenshot = "https://docs.mapbox.com/ios/maps/api/#{version}/img/screenshot.png"
m.social_media_url = 'https://twitter.com/mapbox'
m.documentation_url = 'https://docs.mapbox.com/ios/api/maps/'
m.documentation_url = 'https://docs.mapbox.com/ios/maps/api/'

m.source = {
:http => "https://mapbox.s3.amazonaws.com/mapbox-gl-native/ios/builds/mapbox-ios-sdk-snapshot-dynamic.zip",
Expand Down
6 changes: 3 additions & 3 deletions platform/ios/Mapbox-iOS-SDK-stripped.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|

version = '6.2.1'
version = '6.2.2'

m.name = 'Mapbox-iOS-SDK-stripped'
m.version = "#{version}-stripped"
Expand All @@ -10,9 +10,9 @@ Pod::Spec.new do |m|
m.homepage = 'https://docs.mapbox.com/ios/maps/'
m.license = { :type => 'BSD', :file => 'LICENSE.md' }
m.author = { 'Mapbox' => '[email protected]' }
m.screenshot = "https://docs.mapbox.com/ios/api/maps/#{version}/img/screenshot.png"
m.screenshot = "https://docs.mapbox.com/ios/maps/api/#{version}/img/screenshot.png"
m.social_media_url = 'https://twitter.com/mapbox'
m.documentation_url = 'https://docs.mapbox.com/ios/api/maps/'
m.documentation_url = 'https://docs.mapbox.com/ios/maps/api/'

m.source = {
:http => "https://api.mapbox.com/downloads/v2/mobile-maps/releases/ios/packages/#{version.to_s}/mapbox-ios-sdk-stripped-dynamic.zip",
Expand Down
6 changes: 3 additions & 3 deletions platform/ios/Mapbox-iOS-SDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |m|

version = '6.2.1'
version = '6.2.2'

m.name = 'Mapbox-iOS-SDK'
m.version = version
Expand All @@ -10,9 +10,9 @@ Pod::Spec.new do |m|
m.homepage = 'https://docs.mapbox.com/ios/maps/'
m.license = { :type => 'BSD', :file => 'LICENSE.md' }
m.author = { 'Mapbox' => '[email protected]' }
m.screenshot = "https://docs.mapbox.com/ios/api/maps/#{version}/img/screenshot.png"
m.screenshot = "https://docs.mapbox.com/ios/maps/api/#{version}/img/screenshot.png"
m.social_media_url = 'https://twitter.com/mapbox'
m.documentation_url = 'https://docs.mapbox.com/ios/api/maps/'
m.documentation_url = 'https://docs.mapbox.com/ios/maps/api/'

m.source = {
:http => "https://api.mapbox.com/downloads/v2/mobile-maps/releases/ios/packages/#{version.to_s}/mapbox-ios-sdk-dynamic.zip",
Expand Down
4 changes: 2 additions & 2 deletions platform/ios/app/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.2.1</string>
<string>6.2.2</string>
<key>CFBundleSignature</key>
<string>MBGL</string>
<key>CFBundleVersion</key>
<string>15271</string>
<string>15275</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSLocationTemporaryUsageDescriptionDictionary</key>
Expand Down
4 changes: 2 additions & 2 deletions platform/ios/benchmark/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.2.1</string>
<string>6.2.2</string>
<key>CFBundleSignature</key>
<string>MBGL</string>
<key>CFBundleVersion</key>
<string>15271</string>
<string>15275</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSHumanReadableCopyright</key>
Expand Down
4 changes: 2 additions & 2 deletions platform/ios/framework/Info-static.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleShortVersionString</key>
<string>6.2.1</string>
<string>6.2.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15271</string>
<string>15275</string>
<key>MGLCommitHash</key>
<string>$(CURRENT_COMMIT_HASH)</string>
<key>MGLSemanticVersionString</key>
Expand Down
4 changes: 2 additions & 2 deletions platform/ios/framework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.2.1</string>
<string>6.2.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15271</string>
<string>15275</string>
<key>MGLCommitHash</key>
<string>$(CURRENT_COMMIT_HASH)</string>
<key>MGLSemanticVersionString</key>
Expand Down
18 changes: 9 additions & 9 deletions platform/ios/ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3767,7 +3767,7 @@
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 15271;
CURRENT_PROJECT_VERSION = 15275;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
GCC_PREPROCESSOR_DEFINITIONS = "";
Expand Down Expand Up @@ -3820,7 +3820,7 @@
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 15271;
DYLIB_CURRENT_VERSION = 15275;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = YES;
GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
Expand All @@ -3844,7 +3844,7 @@
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
DEFINES_MODULE = YES;
DYLIB_CURRENT_VERSION = 15271;
DYLIB_CURRENT_VERSION = 15275;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
Expand Down Expand Up @@ -3966,7 +3966,7 @@
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 15271;
CURRENT_PROJECT_VERSION = 15275;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -3990,7 +3990,7 @@
CLANG_ENABLE_MODULES = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 15271;
CURRENT_PROJECT_VERSION = 15275;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
GCC_PREPROCESSOR_DEFINITIONS = "";
Expand Down Expand Up @@ -4108,7 +4108,7 @@
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 15271;
DYLIB_CURRENT_VERSION = 15275;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = YES;
INFOPLIST_FILE = framework/Info.plist;
Expand Down Expand Up @@ -4136,7 +4136,7 @@
DEFINES_MODULE = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 15271;
DYLIB_CURRENT_VERSION = 15275;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_BITCODE = YES;
GCC_PREPROCESSOR_DEFINITIONS = "NDEBUG=1";
Expand Down Expand Up @@ -4183,7 +4183,7 @@
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
DEFINES_MODULE = YES;
DYLIB_CURRENT_VERSION = 15271;
DYLIB_CURRENT_VERSION = 15275;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
Expand All @@ -4208,7 +4208,7 @@
BITCODE_GENERATION_MODE = bitcode;
DEFINES_MODULE = YES;
DEPLOYMENT_POSTPROCESSING = YES;
DYLIB_CURRENT_VERSION = 15271;
DYLIB_CURRENT_VERSION = 15275;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
Expand Down
24 changes: 20 additions & 4 deletions platform/ios/src/MGLCompassButton.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@interface MGLCompassButton ()

@property (nonatomic, weak) MGLMapView *mapView;
@property (nonatomic) CALayer *imageLayer;
@property (nonatomic) MGLCompassDirectionFormatter *accessibilityCompassFormatter;

@end
Expand All @@ -30,8 +31,21 @@ - (instancetype)initWithMapView:(MGLMapView *)mapView {
return self;
}

- (void)setImage:(UIImage *)image {
self.imageLayer.contents = (id)image.CGImage;
}

- (void)commonInit {
self.image = self.compassImage;
UIImage *image = self.compassImage;
CGRect bounds = (CGRect){CGPointZero, image.size};
self.bounds = bounds;

self.imageLayer = [[CALayer alloc] init];
self.imageLayer.frame = bounds;
self.imageLayer.contentsGravity = kCAGravityResizeAspect;

self.image = image;
[self.layer addSublayer:self.imageLayer];

self.compassVisibility = MGLOrnamentVisibilityAdaptive;

Expand All @@ -48,8 +62,6 @@ - (void)commonInit {

self.accessibilityCompassFormatter = [[MGLCompassDirectionFormatter alloc] init];
self.accessibilityCompassFormatter.unitStyle = NSFormattingUnitStyleLong;

[self sizeToFit];
}

- (void)setCompassVisibility:(MGLOrnamentVisibility)compassVisibility {
Expand Down Expand Up @@ -96,7 +108,11 @@ - (void)updateCompass {
- (void)updateCompassAnimated:(BOOL)animated {
CLLocationDirection direction = self.mapView.direction;
CLLocationDirection plateDirection = mbgl::util::wrap(-direction, 0., 360.);
self.transform = CGAffineTransformMakeRotation(MGLRadiansFromDegrees(plateDirection));

[CATransaction begin];
[CATransaction setValue:@(YES) forKey:kCATransactionDisableActions];
self.imageLayer.transform = CATransform3DMakeRotation(MGLRadiansFromDegrees(plateDirection), 0.0, 0.0, 1.0);
[CATransaction commit];

self.isAccessibilityElement = direction > 0;
self.accessibilityValue = [self.accessibilityCompassFormatter stringFromDirection:direction];
Expand Down
1 change: 1 addition & 0 deletions platform/ios/src/MGLCompassButton_Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
+ (instancetype)compassButtonWithMapView:(MGLMapView *)mapView;

@property (nonatomic, weak) MGLMapView *mapView;
@property (nonatomic) CALayer *imageLayer;

- (void)updateCompass;

Expand Down
Loading