Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

368
Views
leaflet.js - how to draw leaflet arc using - start point, end point, radius and turn direction?

Question

  • Using leaflet.js I am trying to draw arc with given radius and turn direction between B and D.

JS fiddle

https://jsfiddle.net/uyLc21fm/68/

example

Inputs:

  • start LAT LON [point B]
  • end LAT LON [point D]
  • radius [in nautical miles]
  • turn direction [left or right]

Required Output:

  • yellow arc

What I have tried so far:

Leaflet.Circle

  • makes full circle not just arc par I need between B and D.

Semicircle module

  • https://github.com/jieter/Leaflet-semicircle problem is, this draws rather "pizza" shapes, not just arcs + requires to compute bearing start/end and center of circle. {I had both computed, but not I was hoping for.} + imprecision causes disconnected between A-B straight and B-C arc

Curve module

  • Problem: hard to set fixed radius with this one.
//var curvedPath = L.curve(
    //    [
    //        'M', latlng1,
    //        'Q', midpointLatLng,
    //        latlng2
    //    ], pathOptions).addTo(map);

constantly curved line

  • have tried this article
  • https://ryancatalani.medium.com/creating-consistently-curved-lines-on-leaflet-b59bc03fa9dc
  • this did not work for me - setting is approximate "curvature". not able to set fixed radius with above..

Below I have also tried, but they shall not be necessary for drawing/final solution - thus I consider them irrelevant.

  • I can compute center of arc.
  • I can compute start/end bearing of turn relative to arc center.
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!