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

Add option to use Rhumb lines #110

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dankarran
Copy link

@dankarran dankarran commented Jul 15, 2024

This pull request adds an option to use straight rhumb lines (and their equivalent bearing) instead of great circle lines. It's still useful in maritime navigation for example, even if it's not the most direct route. It's similar to the way the original leaflet.measure plugin worked.

The calculations are based on the handy website used for the other calculations.

As part of the update I've moved the arcpoints variable into the options array to allow it to be modified. It needs overriding when using rhumb lines, but this PR also then fixes the bearings and midpoint arrow placement compared to just setting the original _arcpoints variable to 2.

@dankarran
Copy link
Author

I've just realised the distances are still using great circles (with the built-in Leaflet .distanceTo() method), so this needs updating still for consistency.

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

Successfully merging this pull request may close these issues.

1 participant