Closed miguel-ribeiro closed 8 years ago
These coordinates are very close to each other, and in the screenshot that's clear; this is definitely not crossing the atlantic. The generated arc looks correct.
Shouldn't the effect be the same regardless of the distance? I see some trignometric is used with a step for the number of points requested. Shouldn't it behave the same because of that?
I meant to say: i ALSO "notice that if I use coordinates far from each other(cross Atlantic), there is a VERY slight curve, but only just."
Blue line: straight Red line: arc (but only just) It is a reaaaaaly slight arc. Is it really supose to be like this? I've seen from other printscreens much more parabolical lines. I'm using [32.6936836, -16.7753468], [0, 0]
Would there be a way to define the angle/radius ?
This library generates great circle arcs, which are a geographically-defined arc. If you're looking for arbitrary curves for graphical purposes, you'll want to use something else.
Hi, I'm using this code to do a small test, and it just displays a straight line. I notice that if I use coordinates far from each other(cross Atlantic), there is a VERY slight curve, but only just. Is there anything that I'm doing wrong? If you can put these coordinates working, could you provide the most basic example on how you did it? Thanks
//load_map.js window.onload = onLoad
function onLoad(){ var map = L.map('map').setView([32.75,-16.97], 11)
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png').addTo(map);
var arc = L.Polyline.Arc([32.6936836, -16.7753468], [32.75, -16.97], { color: "red", vertices: 200, offset:10 }).addTo(map) }
//index.html
```