Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: flip marker image, depending on direction of movement #24

Open
willemx opened this issue Mar 17, 2014 · 4 comments
Open

Comments

@willemx
Copy link

willemx commented Mar 17, 2014

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...)

@codeswithroh
Copy link

@willemx Did you find any solution to your problem?

@willemx
Copy link
Author

willemx commented Jun 3, 2022

@codeswithroh
Copy link

But how are you getting the angle to rotate?

@willemx
Copy link
Author

willemx commented Jun 8, 2022

angle = L.GeometryUtil.bearing(startLatLng, nextLatLng)
using this lib:
https://github.com/makinacorpus/Leaflet.GeometryUtil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants