Igor-Vladyka / leaflet.motion

A simple tool to animate polylines and polygons in different way
https://igor-vladyka.github.io/leaflet.motion/
MIT License
208 stars 44 forks source link

Is possible to make a ping pong animation? #3

Closed tonijota closed 5 years ago

tonijota commented 5 years ago

I mean, when the animation reach the end, loop back and not start over again from the begining.

Igor-Vladyka commented 5 years ago

Yeah. It's simple: you need to create 2 animations (polygon or polilyne), one to show direct animation and second to show reverted animation (with appropriate configurations). And then just put them into L.motion.seq(). Then listen to 'L.Motion.Event.Ended' event from seq manager and start it again.

All needed details you can find in README.

If you have any problem - please create an jqbin or so with an example so I can help you.