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

Cherry picks prs from master to release-z #478

Merged
merged 6 commits into from
Sep 23, 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
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-maps-gl-core/mapbox-ios-sdk-gl-core-static.json" == 4.0.0
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-maps-gl-core/mapbox-ios-sdk-gl-core-static.json" == 5.1.0
github "mapbox/mapbox-events-ios" ~> 0.10.4
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-maps-gl-core/mapbox-ios-sdk-gl-core-static.json" "4.0.0"
binary "https://api.mapbox.com/downloads/v2/carthage/mobile-maps-gl-core/mapbox-ios-sdk-gl-core-static.json" "5.1.0"
github "mapbox/mapbox-events-ios" "v0.10.4"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ $(IOS_OUTPUT_PATH):
$(NETRC_FILE):
@echo "$$NETRC" > $(NETRC_FILE)

$(CARTHAGE_DEPS): $(NETRC_FILE) | $(IOS_OUTPUT_PATH)
$(CARTHAGE_DEPS): | $(NETRC_FILE) $(IOS_OUTPUT_PATH)
carthage bootstrap --platform iOS --use-netrc
@echo "Finishing bootstrapping"

Expand Down
2 changes: 1 addition & 1 deletion platform/darwin/src/MGLMapSnapshotter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ - (void)configureWithOptions:(MGLMapSnapshotOptions *)options {
.withAssetPath(NSBundle.mainBundle.resourceURL.path.UTF8String);

// Create the snapshotter
auto localFontFamilyName = config.localFontFamilyName ? std::string(config.localFontFamilyName.UTF8String) : nullptr;
mbgl::optional<std::string> localFontFamilyName = config.localFontFamilyName ? mbgl::optional<std::string>(std::string(config.localFontFamilyName.UTF8String)) : mbgl::nullopt;
_delegateHost = std::make_unique<MGLMapSnapshotterDelegateHost>(self);
_mbglMapSnapshotter = std::make_unique<mbgl::MapSnapshotter>(
size, pixelRatio, resourceOptions, *_delegateHost, localFontFamilyName);
Expand Down
13 changes: 13 additions & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

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

## 6.2.1 - September 23, 2020

### 🐞 Bug fixes

* 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))
* Fixed an issue with local font glyph rendering, by updating the core library to version 5.1.0. ([#475](https://github.com/mapbox/mapbox-gl-native-ios/pull/475))

### 🔧 Dependencies

* Core library updated to `5.1.0`. ([#475](https://github.com/mapbox/mapbox-gl-native-ios/pull/475))

## 6.2.0 - September 17, 2020

**This release supports iOS 14 and Xcode 12**
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.0</string>
<string>6.2.1</string>
<key>CFBundleVersion</key>
<string>15270</string>
<string>15271</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.0</string>
<string>6.2.1</string>
<key>CFBundleVersion</key>
<string>15270</string>
<string>15271</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#import "MGLMapViewIntegrationTest.h"
#import "MGLTestUtility.h"
#import "MGLMapView_Private.h"

@interface MGLMapView (MGLMapViewPendingBlockTests)
@property (nonatomic) NSMutableArray *pendingCompletionBlocks;
Expand All @@ -14,75 +15,89 @@ @interface MGLMapViewPendingBlockTests : MGLMapViewIntegrationTest
@implementation MGLMapViewPendingBlockTests

- (void)testSetCenterCoordinate {
__typeof__(self) weakSelf = self;

void (^transition)(dispatch_block_t) = ^(dispatch_block_t completion) {
__typeof__(self) strongSelf = weakSelf;

if (strongSelf) {
[strongSelf.mapView setCenterCoordinate:CLLocationCoordinate2DMake(10.0, 10.0)
zoomLevel:10.0
direction:0
animated:NO
completionHandler:completion];
}
else {
completion();
}
};

[self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd)
transition:transition
addToPendingCallback:nil];
[self internal_testSetCenterCoordinate:CLLocationCoordinate2DMake(10.0, 20.0)
zoomLevel:10.0
animated:NO
testName:NSStringFromSelector(_cmd)];
}

- (void)testSetCenterCoordinateAnimated {
[self internal_testSetCenterCoordinate:CLLocationCoordinate2DMake(10.0, 20.0)
zoomLevel:10.0
animated:NO
testName:NSStringFromSelector(_cmd)];
}

- (void)internal_testSetCenterCoordinate:(CLLocationCoordinate2D)coord
zoomLevel:(double)zoomLevel
animated:(BOOL)animated
testName:(NSString*)testName {
__typeof__(self) weakSelf = self;

void (^transition)(dispatch_block_t) = ^(dispatch_block_t completion) {
__typeof__(self) strongSelf = weakSelf;

if (strongSelf) {
[strongSelf.mapView setCenterCoordinate:CLLocationCoordinate2DMake(10.0, 10.0)
zoomLevel:10.0
[strongSelf.mapView setCenterCoordinate:coord
zoomLevel:zoomLevel
direction:0
animated:YES
animated:animated
completionHandler:completion];
}
else {
completion();
}
};

[self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd)
[self internalTestCompletionBlockAddedToPendingForTestName:testName
transition:transition
addToPendingCallback:nil];
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- (void)testSetSameCenterCoordinateBug461 {
[self internal_testSetSameCenterCoordinateBug461Animated:NO testName:NSStringFromSelector(_cmd)];
}

- (void)testSetSameCenterCoordinateBug461Animated {
[self internal_testSetSameCenterCoordinateBug461Animated:YES testName:NSStringFromSelector(_cmd)];
}

- (void)internal_testSetSameCenterCoordinateBug461Animated:(BOOL)animated testName:(NSString*)testName {

CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(10.0, 20.0);
double zoomLevel = 10.0;
// Set the map zoom level to a specific constant
// Set the map center coordinate to a specific constant
[self.mapView setCenterCoordinate:coord
zoomLevel:zoomLevel
animated:NO];

[self.mapView setNeedsRerender];
[self waitForMapViewToIdleWithTimeout:1];

XCTAssert(self.mapView.zoomLevel == zoomLevel);
XCTAssertEqualWithAccuracy(self.mapView.centerCoordinate.latitude, coord.latitude, 0.000001);
XCTAssertEqualWithAccuracy(self.mapView.centerCoordinate.longitude, coord.longitude, 0.000001);

[self internal_testSetCenterCoordinate:coord
zoomLevel:zoomLevel
animated:NO
testName:testName];
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- (void)testSetVisibleCoordinateBounds {
__typeof__(self) weakSelf = self;

void (^transition)(dispatch_block_t) = ^(dispatch_block_t completion) {
__typeof__(self) strongSelf = weakSelf;

if (strongSelf) {
MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1));
[strongSelf.mapView setVisibleCoordinateBounds:unitBounds
edgePadding:UIEdgeInsetsZero
animated:NO
completionHandler:completion];
}
else {
completion();
}
};

[self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd)
transition:transition
addToPendingCallback:nil];
[self internal_testSetVisibleCoordinateBoundsAnimated:NO testName:NSStringFromSelector(_cmd)];
}

- (void)testSetVisibleCoordinateBoundsAnimated {
[self internal_testSetVisibleCoordinateBoundsAnimated:YES testName:NSStringFromSelector(_cmd)];
}

- (void)internal_testSetVisibleCoordinateBoundsAnimated:(BOOL)animated testName:(NSString*)testName {
__typeof__(self) weakSelf = self;

void (^transition)(dispatch_block_t) = ^(dispatch_block_t completion) {
Expand All @@ -92,42 +107,30 @@ - (void)testSetVisibleCoordinateBoundsAnimated {
MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1));
[strongSelf.mapView setVisibleCoordinateBounds:unitBounds
edgePadding:UIEdgeInsetsZero
animated:YES
animated:animated
completionHandler:completion];
}
else {
completion();
}
};

[self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd)
[self internalTestCompletionBlockAddedToPendingForTestName:testName
transition:transition
addToPendingCallback:nil];
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- (void)testSetCamera {
__typeof__(self) weakSelf = self;

void (^transition)(dispatch_block_t) = ^(dispatch_block_t completion) {
__typeof__(self) strongSelf = weakSelf;

if (strongSelf) {
MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1));
MGLMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds];

[strongSelf.mapView setCamera:camera withDuration:0.0 animationTimingFunction:nil completionHandler:completion];
}
else {
completion();
}
};

[self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd)
transition:transition
addToPendingCallback:nil];
[self internal_testSetCameraAnimated:NO testName:NSStringFromSelector(_cmd)];
}

- (void)testSetCameraAnimated {
[self internal_testSetCameraAnimated:YES testName:NSStringFromSelector(_cmd)];
}

- (void)internal_testSetCameraAnimated:(BOOL)animated testName:(NSString*)testName {
__typeof__(self) weakSelf = self;

void (^transition)(dispatch_block_t) = ^(dispatch_block_t completion) {
Expand All @@ -137,41 +140,32 @@ - (void)testSetCameraAnimated {
MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1));
MGLMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds];

[strongSelf.mapView setCamera:camera withDuration:0.3 animationTimingFunction:nil completionHandler:completion];
[strongSelf.mapView setCamera:camera
withDuration:animated ? 0.3 : 0.0
animationTimingFunction:nil
completionHandler:completion];
}
else {
completion();
}
};

[self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd)
[self internalTestCompletionBlockAddedToPendingForTestName:testName
transition:transition
addToPendingCallback:nil];
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- (void)testFlyToCamera {
__typeof__(self) weakSelf = self;

void (^transition)(dispatch_block_t) = ^(dispatch_block_t completion) {
__typeof__(self) strongSelf = weakSelf;

if (strongSelf) {
MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1));
MGLMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds];

[strongSelf.mapView flyToCamera:camera withDuration:0.0 completionHandler:completion];
}
else {
completion();
}
};

[self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd)
transition:transition
addToPendingCallback:nil];
[self internal_testFlyToCameraAnimated:NO testName:NSStringFromSelector(_cmd)];
}

- (void)testFlyToCameraAnimated {
[self internal_testFlyToCameraAnimated:YES testName:NSStringFromSelector(_cmd)];
}

- (void)internal_testFlyToCameraAnimated:(BOOL)animated testName:(NSString*)testName {

__typeof__(self) weakSelf = self;

Expand All @@ -182,19 +176,20 @@ - (void)testFlyToCameraAnimated {
MGLCoordinateBounds unitBounds = MGLCoordinateBoundsMake(CLLocationCoordinate2DMake(0, 0), CLLocationCoordinate2DMake(1, 1));
MGLMapCamera *camera = [strongSelf.mapView cameraThatFitsCoordinateBounds:unitBounds];

[strongSelf.mapView flyToCamera:camera withDuration:0.3 completionHandler:completion];
[strongSelf.mapView flyToCamera:camera
withDuration:animated ? 0.3 : 0.0
completionHandler:completion];
}
else {
completion();
}
};

[self internalTestCompletionBlockAddedToPendingForTestName:NSStringFromSelector(_cmd)
[self internalTestCompletionBlockAddedToPendingForTestName:testName
transition:transition
addToPendingCallback:nil];
}


#pragma mark - test interrupting regular rendering

- (void)testSetCenterCoordinateSetHidden {
Expand Down
2 changes: 1 addition & 1 deletion 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.0'
version = '6.2.1'

m.name = 'Mapbox-iOS-SDK-snapshot-dynamic'
m.version = "#{version}-snapshot"
Expand Down
2 changes: 1 addition & 1 deletion 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.0'
version = '6.2.1'

m.name = 'Mapbox-iOS-SDK-stripped'
m.version = "#{version}-stripped"
Expand Down
2 changes: 1 addition & 1 deletion 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.0'
version = '6.2.1'

m.name = 'Mapbox-iOS-SDK'
m.version = version
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.0</string>
<string>6.2.1</string>
<key>CFBundleSignature</key>
<string>MBGL</string>
<key>CFBundleVersion</key>
<string>15270</string>
<string>15271</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.0</string>
<string>6.2.1</string>
<key>CFBundleSignature</key>
<string>MBGL</string>
<key>CFBundleVersion</key>
<string>15270</string>
<string>15271</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSHumanReadableCopyright</key>
Expand Down
Loading