diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-06-25 22:26:35 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-06-25 22:26:35 -0700 |
commit | 29fd554c326da14badf9531aa5d5eaf7ed7c4c50 (patch) | |
tree | 4559d2984a1cdda21c3d179e8b01f6565623a577 /platform | |
parent | bcbb56c1886ef1f369c50ea675a97c48718e78ce (diff) | |
download | qtlocation-mapboxgl-29fd554c326da14badf9531aa5d5eaf7ed7c4c50.tar.gz |
Implemented -setVisibleCoordinateBounds:
Followup to #1783: Implemented the non-animated version of fit to bounds and makes it a KVO-compliant property.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/MGLMapView.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 8fdfa294aa..50f5a1f867 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -1461,6 +1461,11 @@ mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coord return MGLCoordinateBoundsFromLatLngBounds(self.viewportBounds); } +- (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds +{ + [self setVisibleCoordinateBounds:bounds animated:NO]; +} + - (void)setVisibleCoordinateBounds:(MGLCoordinateBounds)bounds animated:(BOOL)animated { [self setVisibleCoordinateBounds:bounds edgePadding:UIEdgeInsetsZero animated:animated]; @@ -1471,8 +1476,10 @@ mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coord // NOTE: does not disrupt tracking mode CGFloat duration = animated ? MGLAnimationDuration : 0; + [self willChangeValueForKey:@"visibleCoordinateBounds"]; mbgl::EdgeInsets mbglInsets = {insets.top, insets.left, insets.bottom, insets.right}; _mbglMap->fitBounds(MGLLatLngBoundsFromCoordinateBounds(bounds), mbglInsets, secondsAsDuration(duration)); + [self didChangeValueForKey:@"visibleCoordinateBounds"]; [self unrotateIfNeededAnimated:animated]; |