summaryrefslogtreecommitdiff
path: root/platform/ios
diff options
context:
space:
mode:
authorJulian Rex <julian.rex@gmail.com>2019-03-27 09:58:41 -0400
committerGitHub <noreply@github.com>2019-03-27 09:58:41 -0400
commitc7d53676d0dcbc72d71d921e385c656087b788a5 (patch)
treed785dccc56729a28d602cb613bd69e4388906364 /platform/ios
parentf07a24dd3d2b67d2b3525f9c65f6152048454640 (diff)
downloadqtlocation-mapboxgl-c7d53676d0dcbc72d71d921e385c656087b788a5.tar.gz
[ios, core] Updates project for iOS SDK 12.2 / Always use vendored optional (#14241)
Diffstat (limited to 'platform/ios')
-rw-r--r--platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m1
-rw-r--r--platform/ios/Integration Tests/MGLCameraTransitionTests.mm2
-rw-r--r--platform/ios/ios.xcodeproj/project.pbxproj6
-rw-r--r--platform/ios/src/MGLMapView.mm13
4 files changed, 13 insertions, 9 deletions
diff --git a/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m b/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m
index 7ec45de072..0b32df55b4 100644
--- a/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m
+++ b/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.m
@@ -405,7 +405,6 @@ static const CGFloat kAnnotationScale = 0.125f;
NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReuseIdentifer";
- CGFloat epsilon = 0.0000001;
CGSize size = self.mapView.bounds.size;
CGSize annotationSize = CGSizeMake(40.0, 40.0);
diff --git a/platform/ios/Integration Tests/MGLCameraTransitionTests.mm b/platform/ios/Integration Tests/MGLCameraTransitionTests.mm
index e422c46cf4..60d5fc6c9a 100644
--- a/platform/ios/Integration Tests/MGLCameraTransitionTests.mm
+++ b/platform/ios/Integration Tests/MGLCameraTransitionTests.mm
@@ -277,7 +277,7 @@
// Now set another coordinate.
MGLMapCamera *camera = [MGLMapCamera cameraLookingAtCenterCoordinate:target2
- fromDistance:altitude
+ altitude:altitude
pitch:0.0
heading:0.0];
diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj
index a514f4a017..5122a60b11 100644
--- a/platform/ios/ios.xcodeproj/project.pbxproj
+++ b/platform/ios/ios.xcodeproj/project.pbxproj
@@ -3677,7 +3677,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Integration Tests/integration-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
- SWIFT_VERSION = 3.0;
+ SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Integration Test Harness.app/Integration Test Harness";
};
@@ -3707,7 +3707,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Integration Tests/integration-Bridging-Header.h";
- SWIFT_VERSION = 3.0;
+ SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Integration Test Harness.app/Integration Test Harness";
};
@@ -3992,7 +3992,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.mapbox.integration-tests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Integration Tests/integration-Bridging-Header.h";
- SWIFT_VERSION = 3.0;
+ SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Integration Test Harness.app/Integration Test Harness";
};
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 50e022013b..eab690b854 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -2512,10 +2512,15 @@ public:
{
MGLLogInfo(@"Resetting the map to the current style’s default viewport.");
auto camera = self.mbglMap.getStyle().getDefaultCamera();
- CGFloat pitch = *camera.pitch;
- CLLocationDirection heading = mbgl::util::wrap(*camera.bearing, 0., 360.);
- CLLocationDistance altitude = MGLAltitudeForZoomLevel(*camera.zoom, pitch, 0, self.frame.size);
- self.camera = [MGLMapCamera cameraLookingAtCenterCoordinate:MGLLocationCoordinate2DFromLatLng(*camera.center)
+
+ double pitch = camera.pitch ? *camera.pitch : 0.0;
+ double bearing = camera.bearing ? *camera.bearing : 0.0;
+ double zoom = camera.zoom ? *camera.zoom : 0.0;
+ mbgl::LatLng center = camera.center ? *camera.center : mbgl::LatLng();
+
+ CLLocationDirection heading = mbgl::util::wrap(bearing, 0., 360.);
+ CLLocationDistance altitude = MGLAltitudeForZoomLevel(zoom, pitch, 0, self.frame.size);
+ self.camera = [MGLMapCamera cameraLookingAtCenterCoordinate:MGLLocationCoordinate2DFromLatLng(center)
altitude:altitude
pitch:pitch
heading:heading];