StephanGeorg / staticmaps

A Node.js library for creating map images with markers, polylines, polygons and text.
MIT License
167 stars 49 forks source link

Support for geodesic lines #15

Open lokus1980 opened 6 years ago

lokus1980 commented 6 years ago

Hello, as a new feature it would be great if the library would support drawing geodesic lines that follow the curvature of the Earth. Especially useful when connecting two very distant places. In this case, a straight line does not look good. Would be great to have a flag so we can choose between these two line styles. Thanks!

StephanGeorg commented 6 years ago

I implemented it via turf-arc. But there are some bugs when crossing the dateline.

lokus1980 commented 6 years ago

Wow, thanks Stephan! It's sad they have bugs, maybe there is some other lib which does it properly. Anyway, no rush, for now I can easily live with straight lines :)

On Tue, 4 Sep 2018 at 16:52, Stephan Georg notifications@github.com wrote:

I implemented it via turf-arc https://github.com/stepankuzmin/turf-arc#readme. But there are some bugs when crossing the dateline.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/StephanGeorg/staticmaps/issues/15#issuecomment-418260055, or mute the thread https://github.com/notifications/unsubscribe-auth/AgkFW1dfkSO1puWHZ-DXxnoQ37sM6q5Iks5uXiMZgaJpZM4WW6Kc .

-- Regards/Pozdrawiam, Łukasz Szkup

StephanGeorg commented 6 years ago

No, it's more a mathematical thing than a software bug. In the meantime you can calculate the geodesic path and add the coordinates as a polyline.