Skip to content

Add option to use Rhumb lines#110

Open
dankarran wants to merge 7 commits intoppete2:masterfrom
dankarran:rhumblines
Open

Add option to use Rhumb lines#110
dankarran wants to merge 7 commits intoppete2:masterfrom
dankarran:rhumblines

Conversation

@dankarran
Copy link
Copy Markdown

@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
Copy Markdown
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