[ios] Fix toCamera.centerCoordinate in shouldChangeFromCamera (#10433)

* [ios] Fix toCamera.centerCoordinate in shouldChangeFromCamera has same center as oldCamera.

* [ios] Update changelog.

* [ios] Remove unnecessary variables.

* [ios] Clarify changelog doc.
This commit is contained in:
Fabian Guerra Soto
2017-11-14 13:37:45 -05:00
committed by GitHub
parent f0f113bafc
commit addefe539a
2 changed files with 7 additions and 7 deletions

View File

@@ -37,6 +37,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Users of VoiceOver can now swipe left and right to navigate among visible places, points of interest, and roads. ([#9950](https://github.com/mapbox/mapbox-gl-native/pull/9950))
* Increased the default maximum zoom level from 20 to 22. ([#9835](https://github.com/mapbox/mapbox-gl-native/pull/9835))
* Fixed an issue where the same value was passed in as the `oldCamera` and `newCamera` parameters to the `-[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:]` method. ([#10433](https://github.com/mapbox/mapbox-gl-native/pull/10433))
### Other changes

View File

@@ -1801,18 +1801,17 @@ public:
return panCamera;
}
- (MGLMapCamera *)cameraByZoomingToZoomLevel:(double)zoom aroundAnchorPoint:(CGPoint)anchorPoint
- (MGLMapCamera *)cameraByZoomingToZoomLevel:(double)zoom aroundAnchorPoint:(CGPoint)anchorPoint
{
mbgl::EdgeInsets padding = MGLEdgeInsetsFromNSEdgeInsets(self.contentInset);
mbgl::CameraOptions currentCameraOptions = _mbglMap->getCameraOptions(padding);
MGLMapCamera *camera;
mbgl::ScreenCoordinate anchor = mbgl::ScreenCoordinate { anchorPoint.x, anchorPoint.y };
mbgl::EdgeInsets padding = mbgl::EdgeInsets(anchor.y, anchor.x, self.size.height - anchor.y, self.size.width - anchor.x);
mbgl::CameraOptions currentCameraOptions = _mbglMap->getCameraOptions(padding);
currentCameraOptions.zoom = mbgl::util::clamp(zoom, self.minimumZoomLevel, self.maximumZoomLevel);
currentCameraOptions.anchor = anchor;
camera = [self cameraForCameraOptions:currentCameraOptions];
MGLCoordinateBounds bounds = MGLCoordinateBoundsFromLatLngBounds(_mbglMap->latLngBoundsForCamera(currentCameraOptions));
return camera;
return [self cameraThatFitsCoordinateBounds:bounds];
}
- (MGLMapCamera *)cameraByRotatingToDirection:(CLLocationDirection)degrees aroundAnchorPoint:(CGPoint)anchorPoint