diff options
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/CHANGELOG.md | 4 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.h | 3 | ||||
-rw-r--r-- | platform/macos/src/MGLMapView.mm | 3 |
3 files changed, 8 insertions, 2 deletions
diff --git a/platform/macos/CHANGELOG.md b/platform/macos/CHANGELOG.md index e3f1c84547..520f8c204b 100644 --- a/platform/macos/CHANGELOG.md +++ b/platform/macos/CHANGELOG.md @@ -6,6 +6,10 @@ * 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.contentInsets` property to the `edgePadding` parameter. ([#14813](https://github.com/mapbox/mapbox-gl-native/pull/14813)) + ## 0.14.0 - May 22, 2018 ### Styles and rendering diff --git a/platform/macos/src/MGLMapView.h b/platform/macos/src/MGLMapView.h index ddb5747109..21ae8c2974 100644 --- a/platform/macos/src/MGLMapView.h +++ b/platform/macos/src/MGLMapView.h @@ -325,7 +325,8 @@ MGL_EXPORT IB_DESIGNABLE /** 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/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 589a39f0b3..04b895bb50 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -1168,10 +1168,11 @@ public: - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion { MGLLogDebug(@"Setting camera: %@ duration: %f animationTimingFunction: %@", camera, duration, function); - [self setCamera:camera withDuration:duration animationTimingFunction:function edgePadding:self.contentInsets completionHandler:completion]; + [self setCamera:camera withDuration:duration animationTimingFunction:function edgePadding:NSEdgeInsetsZero completionHandler:completion]; } - (void)setCamera:(MGLMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function edgePadding:(NSEdgeInsets)edgePadding completionHandler:(nullable void (^)(void))completion { + edgePadding = MGLEdgeInsetsInsetEdgeInset(edgePadding, self.contentInsets); mbgl::AnimationOptions animationOptions; if (duration > 0) { animationOptions.duration.emplace(MGLDurationFromTimeInterval(duration)); |