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
Currently, the rotateTo() function only allows for rotation in the clockwise direction. It would ideal if the direction could be controlled as an option or if it did it automatically in background depending on current rotation and the new specified rotation.
The use case is car navigation: if the map can rotate only one direction when taking a 90 degree left hand turn, it rotates a whole 270 degrees in the opposite direction.
Yes. Pretty easy to add. Looks like for this use case, it would be sufficient to rotate to the closest angle automatically instead of having an option.
Would be nice to have option for rotate direction anyhow. When doing .flyTo's for example, it's nice to decide which way it goes. I can't find where in the code this should be added, any clues?
Activity
mourner commentedon Nov 8, 2014
Yes. Pretty easy to add. Looks like for this use case, it would be sufficient to rotate to the closest angle automatically instead of having an option.
rotate to the closest bearing, close #818
mourner commentedon Nov 10, 2014
See PR #821, should make all animations rotate to the closest bearing now.
knutole commentedon Dec 7, 2014
Would be nice to have option for rotate direction anyhow. When doing
.flyTo's for example, it's nice to decide which way it goes. I can't find where in the code this should be added, any clues?mourner commentedon Dec 7, 2014
@knutole it's in
easings.js,_normalizeBearingmethod.knutole commentedon Dec 7, 2014
So the rotation is decided simply from
bearingbeing a positive or negative integer?mourner commentedon Dec 7, 2014
@knutole no, it's decided based on what direction it's closer to rotate to.
knutole commentedon Dec 8, 2014
Thank you.