Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAnimationTo can create bearing changes of almost a full circle when changing around 180 and -180 degrees. #851
Comments
|
Thanks! |
|
|
|
I have carefully reviewed your demo, the main concern of this proposal is: If users want to intentionally rotate map with the angle diff > 180, they can never achieve it. I think we should not change the Get back to your demo, you can adjust bearings before passing to |
|
The problem of rotating almost 360 degrees only occurs when flipping from -180 to 180 or vice versa. In all other cases the rotation is always the shortest angle (< 180). Perhaps adding an extra option to animateTo would help: Adjusting the bearings before passing to map.animateTo does not work (or I am doing it in a wrong way) since I start the next animation before the current one in ended. Doing this makes the route animation very fluent. |
|
Yes, a Could you have a test to see if it works? |
|
I'm not sure what you mean with 'Could you have a test to see if it works'.
As far as I'm concerned rotationDirection would be: |
|
1 will be great! I prefer |
|
Okay, Please give me some time. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

maptalks's version used: 0.42.2, browser firefox or chrome
AnimationTo can create bearing changes of almost a full circle when changing around 180 and -180 degrees.
When I try to animate a route which goes from north to south, the bearing can change from around 180 to -180. e.g. a change from -178 to 177 is required which means a change of 5 degrees.
The animation is generating frames which go from -178 to 177 by positive increments of the bearing leading to a delta angle of 355 degrees instead of 5.
Please have a look of my proposed changes in Map.Anim.js which make sure the bearing change is always below 180 degrees,
Please have a look at my test html script which demonstrates the behaviour and works as expected after applying the proposed change.
Apart from this small bug, the library works extremely well and is easy to use. Thanks.
Map_Anim_js.zip