diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 1f04dede2a7..079e9310b5b 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -6,7 +6,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT ### 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)) +* Setting `MGLMapView.contentInset` now moves the map’s focal point to the center of the content frame after insetting. ([#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664)) ## 5.0.0 - May 22, 2019 diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index e6323d8bc17..bdf57168c50 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -1088,7 +1088,7 @@ - (void)setContentInset:(UIEdgeInsets)contentInset animated:(BOOL)animated [self didUpdateLocationWithUserTrackingAnimated:animated]; } - // Compass, logo and attribution button constraints needs to be updated.z + // Compass, logo and attribution button constraints needs to be updated. [self installConstraints]; } diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index 7aae0f2d6bf..5df7388f738 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -4,7 +4,7 @@ ### 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)) +* Setting `MGLMapView.contentInsets` now moves the map’s focal point to the center of the content frame after insetting. ([#14664](https://github.com/mapbox/mapbox-gl-native/pull/14664)) ## 0.14.0 - May 22, 2018 diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 77eb300aef8..1f4730cc50b 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1198,7 +1198,7 @@ - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration a }; } - if ([self.camera isEqualToMapCamera:camera]) { + if ([self.camera isEqualToMapCamera:camera] && NSEdgeInsetsEqual(edgePadding, NSEdgeInsetsZero)) { if (completion) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ completion(); @@ -1311,7 +1311,7 @@ - (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds edgePadding:(NSEd } MGLMapCamera *camera = [self cameraForCameraOptions:cameraOptions]; - if ([self.camera isEqualToMapCamera:camera]) { + if ([self.camera isEqualToMapCamera:camera] && NSEdgeInsetsEqual(insets, NSEdgeInsetsZero)) { return; }