Leaflet.AnimatedMarker
Leaflet.AnimatedMarker copied to clipboard
feature request: flip marker image, depending on direction of movement
First: thank you for this nice plugin!
I am using it to display a walking route using a "walking person" icon. When the route is headed east-west, the person icon is walking in its natural forward direction. When the route is west-east however, the icon is walking backwards. I should like to "flip" the icon when changing direction. Another option would be to rotate the icon depending on the compass angle of each route segment. (BTW: I would prefer the flip option, because rotating would make my walking person icon move upside-down when heading westwards...)
@willemx Did you find any solution to your problem?
yes, i put something together using https://github.com/bbecquet/Leaflet.RotatedMarker and https://gitlab.com/IvanSanchez/Leaflet.Marker.SlideTo
But how are you getting the angle to rotate?
angle = L.GeometryUtil.bearing(startLatLng, nextLatLng)
using this lib:
https://github.com/makinacorpus/Leaflet.GeometryUtil