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.
Updating and restoring camera pitch causes a shift north #14362
When changing the pitch of the current camera to a different angle, and changing it back to the original angle, the map has moved from its original position. This does NOT happen when doing the same thing with a two finger pan.
From what I suspect it may have to do with the edge padding, caused by the difference between using CameraOptions' anchor and center properties. The pan method sets the anchor to the center coordinate, whereas in my programmatic camera change I can not access this property and use the current camera's center.
Steps to reproduce
Ensure a 0 pitch of the current map camera
Programmatically obtain the current map's camera, set the pitch to an angle of 45 degrees, and call setCamera: on the map with the newly created camera.
Programmatically change the map's camera back to its original pitch angle of 0 degrees.
It seems to only occur when edgePadding is provided when updating the map's camera. Perhaps I'm misinterpreting the meaning of the edge padding? See this line
Activity
TimWatson commentedon Apr 9, 2019
This might be related to #14150
datwelk commentedon Apr 26, 2019
@friedbunny is there anything I could do to help resolve this issue? Would a sample project help (I'm looking at the 'needs reproduction' label)?
julianrex commentedon Apr 26, 2019
@datwelk a reproduction sample project would be most welcome!
datwelk commentedon Apr 29, 2019
@julianrex here you go: https://github.com/datwelk/MapboxPerspectiveBug
It seems to only occur when
edgePaddingis provided when updating the map's camera. Perhaps I'm misinterpreting the meaning of the edge padding? See this lineastojilj commentedon May 15, 2019
@datwelk thanks.
Fix for this is part of PR #14664. I used this patch with iOS demo to reproduce/verify it.