You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
oldCamera and newCamera have same center coordinate in mapView:shouldChangeFromCamera:toCamera: #10391
The oldCamera and newCamera should have different center coordinates.
Actual behavior
They have the same center coordinate in -mapView:shouldChangeFromCamera:toCamera: .
The same behavior occurs with other gesture-based region changes. It looks like the new camera is being created with
(cameraByZoomingToZoomLevel:aroundAnchorPoint)[https://github.com/mapbox/mapbox-gl-native/blob/0ef7b7154f6d4498077a83db5c486c61bc34938c/platform/ios/src/MGLMapView.mm#L1867], but I am not sure whether also creates a center coordinate for the camera.
I explicitly set the new camera's center coordinate after cameraByZoomingToZoomLevel is called here and that seemed to fix the issue for the double tap. toCamera.centerCoordinate = [self convertPoint:anchorPoint toCoordinateFromView:self];
I explicitly set the new camera's center coordinate after cameraByZoomingToZoomLevel is called here and that seemed to fix the issue for the double tap. toCamera.centerCoordinate = [self convertPoint:anchorPoint toCoordinateFromView:self];
This assumes that the user double-taps on the center of the map view or spreads two fingers apart over the center. However, if the gesture isn’t centered on the map view, then this camera will be calculated as if the view were jumping to the gesture’s center instead of just being anchored there.
Activity
1ec5 commentedon Nov 10, 2017
This assumes that the user double-taps on the center of the map view or spreads two fingers apart over the center. However, if the gesture isn’t centered on the map view, then this camera will be calculated as if the view were jumping to the gesture’s center instead of just being anchored there.
fabian-guerra commentedon Nov 16, 2017
Fixed in #10433