-
Notifications
You must be signed in to change notification settings - Fork 80
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
Fix angulation of distance markers's arrows when preferCanvas: false
#207
Conversation
Removed RAD to DEG angle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @makenshikuro,
are you trying to fix a bug? if so, can you also attach a couple of self-explanatory pictures showing the before / after? (also a demo wouldn't hurt).
@@ -206,7 +206,7 @@ L.DistanceMarkers = L.LayerGroup.extend({ | |||
iconSize: options.arrowSize, | |||
}), | |||
// NB the following option is added by "leaflet-rotate" | |||
rotation: angle * L.DomUtil.RAD_TO_DEG, | |||
rotation: angle, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// NB the following option is added by "leaflet-rotate"
rotation: angle * L.DomUtil.RAD_TO_DEG,
Before I get into the code, did you notice the comment above? (that is: are you including this library as well? Raruto/leaflet-rotate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Raruto.
Sorry for long time.
In this moment don't remember if i put the library ( i would want say yes but i'm not sure),
I will open the project and inspect it a second time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've visited some of your demo about leaflet-elevation and the arrows don't show the correct direction way.
For example: leaflet-elevation/i18n-strings or
leaflet-elevation/dynamic-runner the arrows point incorrectly or so I think.
With this change, the arrows point the correct direction in every moment.
RouteMap for University of Valencia
Answering you about the library Raruto/leaflet-rotate. No, I tried to use in my first attempt but I didn't need rotate all map. Anyway, the demos of leaflet-elevation don't use the library leaflet-rotate and the arrows point to the wrong direction. Maybe I'm doing something wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@makenshikuro just to know, arrows are shown correctly if instead you set preferCanvas: true
?
preferCanvas: false
Patch released in version 2.2.8 |
Removed RAD to DEG angle
When calculating the slope with atan2 the degrees are obtained.
I guess you don't need to transform RAD to DEG.
I changed it and everything works perfectly.
Can you verify?