diff options
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/CHANGELOG.md | 6 | ||||
-rw-r--r-- | platform/ios/app/MBXViewController.m | 4 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 18 |
3 files changed, 17 insertions, 11 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index d1817b734f..1f04dede2a 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -2,6 +2,12 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) to get started. +## master + +### Styles and rendering + +* Implemented asymmetric center of perspective: fixed an issue that caused the focal point to be always based on the view's horizontal center when setting [MGLMapView contentInset](https://docs.mapbox.com/ios/api/maps/5.0.0/Classes/MGLMapView.html#/c:objc(cs)MGLMapView(py)contentInset). ([#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664)) + ## 5.0.0 - May 22, 2019 This release improves how monthly active users are counted. By upgrading to this release, you are opting into the changes outlined in [this blog post](https://www.mapbox.com/52219) and [#14421](https://github.com/mapbox/mapbox-gl-native/pull/14421). diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 567ca151f7..893cee1cdc 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -788,14 +788,14 @@ CLLocationCoordinate2D randomWorldCoordinate() { heading:0]; __weak typeof(self) weakSelf = self; [self.mapView setCamera:camera withDuration:0.3 animationTimingFunction:nil completionHandler:^{ - [weakSelf.mapView setContentInset:contentInsets animated:TRUE]; + [weakSelf.mapView setContentInset:contentInsets animated:YES]; }]; } else { [self.view sendSubviewToBack:self.contentInsetsOverlays[0]]; [self.view sendSubviewToBack:self.contentInsetsOverlays[1]]; [self.view sendSubviewToBack:self.contentInsetsOverlays[2]]; [self.view sendSubviewToBack:self.contentInsetsOverlays[3]]; - [self.mapView setContentInset:_originalContentInsets animated:TRUE]; + [self.mapView setContentInset:_originalContentInsets animated:YES]; } break; } diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index bc4900ace9..e6323d8bc1 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1079,7 +1079,7 @@ public: if (self.userTrackingMode == MGLUserTrackingModeNone) { // Don’t call -setCenterCoordinate:, which resets the user tracking mode. - [self _setCenterCoordinate:self.centerCoordinate edgePadding:contentInset zoomLevel:self.zoomLevel direction:self.direction duration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil completionHandler:NULL]; + [self _setCenterCoordinate:self.centerCoordinate edgePadding:contentInset zoomLevel:self.zoomLevel direction:self.direction duration:animated ? MGLAnimationDuration : 0 animationTimingFunction:nil completionHandler:nil]; _contentInset = contentInset; } else @@ -1088,7 +1088,7 @@ public: [self didUpdateLocationWithUserTrackingAnimated:animated]; } - // Compass, logo and attribution button constraints needs to be updated. + // Compass, logo and attribution button constraints needs to be updated.z [self installConstraints]; } @@ -3290,7 +3290,7 @@ public: zoomLevel, direction, MGLStringFromBOOL(animated)); - [self setCenterCoordinate:centerCoordinate zoomLevel:zoomLevel direction:direction animated:animated completionHandler:NULL]; + [self setCenterCoordinate:centerCoordinate zoomLevel:zoomLevel direction:direction animated:animated completionHandler:nil]; } - (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion @@ -3554,7 +3554,7 @@ public: } MGLMapCamera *camera = [self cameraForCameraOptions:cameraOptions]; - if ([self.camera isEqualToMapCamera:camera]) + if ([self.camera isEqualToMapCamera:camera] && UIEdgeInsetsEqualToEdgeInsets(_contentInset, insets)) { if (completion) { @@ -3671,7 +3671,7 @@ public: - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function { MGLLogDebug(@"Setting camera: %@ duration: %f animationTimingFunction: %@", camera, duration, function); - [self setCamera:camera withDuration:duration animationTimingFunction:function completionHandler:NULL]; + [self setCamera:camera withDuration:duration animationTimingFunction:function completionHandler:nil]; } - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion @@ -3707,7 +3707,7 @@ public: }; } - if ([self.camera isEqualToMapCamera:camera]) + if ([self.camera isEqualToMapCamera:camera] && UIEdgeInsetsEqualToEdgeInsets(_contentInset, edgePadding)) { if (completion) { @@ -3778,7 +3778,7 @@ public: }; } - if ([self.camera isEqualToMapCamera:camera]) + if ([self.camera isEqualToMapCamera:camera] && UIEdgeInsetsEqualToEdgeInsets(_contentInset, insets)) { if (completion) { @@ -3884,7 +3884,7 @@ public: return self.residualCamera; } - mbgl::CameraOptions mapCamera = self.mbglMap.getCameraOptions(cameraOptions.padding.value_or(mbgl::EdgeInsets())); + mbgl::CameraOptions mapCamera = self.mbglMap.getCameraOptions(); CLLocationCoordinate2D centerCoordinate = MGLLocationCoordinate2DFromLatLng(cameraOptions.center ? *cameraOptions.center : *mapCamera.center); double zoomLevel = cameraOptions.zoom ? *cameraOptions.zoom : self.zoomLevel; CLLocationDirection direction = cameraOptions.bearing ? mbgl::util::wrap(*cameraOptions.bearing, 0., 360.) : self.direction; @@ -5678,7 +5678,7 @@ public: direction:self.directionByFollowingWithCourse duration:animated ? MGLUserLocationAnimationDuration : 0 animationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear] - completionHandler:NULL]; + completionHandler:nil]; } /// Changes the viewport based on a significant location update, such as the |