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.
.centerCoordinate incorrect after zoom gesture #14977
In v5.1, It looks the mapView.centerCoordinate is being set to the center of the two finger zoom gesture, rather than the center of the mapView. Panning with one finger does not cause an issue. The issue does not exist in v4.9 (did not test v5.0).
Steps to reproduce
Set the center coordinate of the map like so mapView.setCenter(someCoord, zoomLevel: 9, direction: 0.0, animated: true)
Pan the map with one finger
Read mapView.centerCoordinate on mapView(_ mapView: MGLMapView, regionDidChangeAnimated animated: Bool). The center coordinate correctly reflects the new center of the mapView
Zoom and pan the map with two finger pinch gesture so that the zoom and center point change
Read mapView.centerCoordinate on mapView(_ mapView: MGLMapView, regionDidChangeAnimated animated: Bool). The center coordinate does not correctly reflect the new center of the mapView
Expected behavior
.centerCoordinate reports the center of the mapView after two finger zoom/pan
Actual behavior
.centerCoordinate appears to report the center two finger gesture as the .centerPoint on regionDidChange
Hi!
I was directed here by Mapbox support since I was reporting a similar issue which probably is the very same bug. Fwiw I'm adding my findings here.
This bug turned up when we upgraded from 4.9 to 5.1 and I'm certain it wasn't there before. Also, I've only been able to reproduce on a physical device and not on a simulator. Maybe this is because the simulator doesn't pan and zoom in the same gesture as the physical device does?
I've modified the SimpleMapViewExample_Swift class from the demo app to help demonstrate the issue:
I'm pretty sure issue #14192 is also related to that...
After pinching gesture to zoom, trying to tap at features/annotations becomes a messy thing - but if you double tap to zoom, it's fine.
Activity
marhas commentedon Jul 2, 2019
Hi!
I was directed here by Mapbox support since I was reporting a similar issue which probably is the very same bug. Fwiw I'm adding my findings here.
This bug turned up when we upgraded from 4.9 to 5.1 and I'm certain it wasn't there before. Also, I've only been able to reproduce on a physical device and not on a simulator. Maybe this is because the simulator doesn't pan and zoom in the same gesture as the physical device does?
I've modified the SimpleMapViewExample_Swift class from the demo app to help demonstrate the issue:
marhas commentedon Jul 2, 2019
Here's a video that demonstrates the issue using the code above: https://www.dropbox.com/s/k3sihajq5ojm1u0/mapbox_zoom_bug.mov?dl=0
victorlsn commentedon Jul 2, 2019
I'm pretty sure issue #14192 is also related to that...
After pinching gesture to zoom, trying to tap at features/annotations becomes a messy thing - but if you double tap to zoom, it's fine.
cbo1964 commentedon Jul 9, 2019
Hi,
I think also the problem I'm facing #15082 is strictly related.
Very easy to replicate:
friedbunny commentedon Jul 9, 2019
Similar to what you’re describing, @cbo1964, this issue also seems to be manifesting during any rotation gesture:
tmpsantos commentedon Jul 12, 2019
Incoming fix #15097
[ios][macos] Fix center coordinate incorrect after pinch gesture
[ios][macos] Fix center coordinate incorrect after pinch gesture
[ios][macos] Fix center coordinate incorrect after pinch gesture
[ios][macos] Fix center coordinate incorrect after pinch gesture