diff options
Diffstat (limited to 'platform/ios')
-rw-r--r-- | platform/ios/CHANGELOG.md | 4 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.h | 3 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 3ddeb6b314..045daf4cad 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -8,6 +8,10 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * 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)) +### Other changes + +* The `-[MGLMapView setCamera:withDuration:animationTimingFunction:edgePadding:completionHandler:]` method now adds the current value of the `MGLMapView.contentInset` property to the `edgePadding` parameter. ([#14813](https://github.com/mapbox/mapbox-gl-native/pull/14813)) + ## 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/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 63bd28fc0c..3baae2ee3c 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -1036,7 +1036,8 @@ MGL_EXPORT /** Moves the viewpoint to a different location with respect to the map with an - optional transition duration and timing function. + optional transition duration and timing function, and optionally some additional + padding on each side. @param camera The new viewpoint. @param duration The amount of time, measured in seconds, that the transition diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index c2ab9c9fc1..077729d448 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -3557,7 +3557,7 @@ public: - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion { MGLLogDebug(@"Setting camera: %@ duration: %f animationTimingFunction: %@ completionHandler: %@", camera, duration, function, completion); - [self setCamera:camera withDuration:duration animationTimingFunction:function edgePadding:self.contentInset completionHandler:completion]; + [self setCamera:camera withDuration:duration animationTimingFunction:function edgePadding:UIEdgeInsetsZero completionHandler:completion]; } - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function edgePadding:(UIEdgeInsets)edgePadding completionHandler:(nullable void (^)(void))completion { @@ -3571,6 +3571,8 @@ public: } MGLLogDebug(@"Setting camera: %@ duration: %f animationTimingFunction: %@ edgePadding: %@ completionHandler: %@", camera, duration, function, NSStringFromUIEdgeInsets(edgePadding), completion); + + edgePadding = MGLEdgeInsetsInsetEdgeInset(edgePadding, self.contentInset); mbgl::AnimationOptions animationOptions; if (duration > 0) |