From f6d652ddddd1181604b41d38459e085314080575 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/test/MGLMapViewLayoutTests.m') 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 4919099ea9c7e5d2a0ed261b169c7c6a0e86a43f Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 2 Mar 2018 13:13:57 -0500 Subject: [ios] Add MGLMapView.showsScale to control scale bar visibility (#11335) - Fixes scale bar not being visible until a camera change event. - Adds IBInspectable for scale bar visibility. - Add tests of the scale bar being added to the map view --- platform/ios/test/MGLMapViewLayoutTests.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'platform/ios/test/MGLMapViewLayoutTests.m') diff --git a/platform/ios/test/MGLMapViewLayoutTests.m b/platform/ios/test/MGLMapViewLayoutTests.m index e707cfdb41..16f6cdada3 100644 --- a/platform/ios/test/MGLMapViewLayoutTests.m +++ b/platform/ios/test/MGLMapViewLayoutTests.m @@ -37,14 +37,15 @@ self.styleLoadingExpectation = [self expectationWithDescription:@"Map view should finish loading style."]; [self waitForExpectationsWithTimeout:1 handler:nil]; + self.mapView.showsScale = YES; + //set zoom and heading so that scale bar and compass will be shown - [self.mapView setZoomLevel:4.5 animated:NO]; + [self.mapView setZoomLevel:10.0 animated:NO]; [self.mapView.camera setHeading:12.0]; //invoke layout [self.superView setNeedsLayout]; [self.superView layoutIfNeeded]; - } - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { -- cgit v1.2.1