Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

370
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda