Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

382
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda