No need to convert lat/lon to latitude/longitude for geolib
This commit is contained in:
parent
56009e2502
commit
4520ce647f
|
@ -407,15 +407,10 @@ different sequence of nodes in two or more lines.`);
|
|||
|
||||
for (let i = 1; i < points.length; ++i)
|
||||
{
|
||||
const len = geolib.getPreciseDistance(
|
||||
...[points[i - 1], points[i]]
|
||||
.map(({lat, lon}) => ({
|
||||
latitude: lat,
|
||||
longitude: lon
|
||||
})),
|
||||
);
|
||||
|
||||
points[i].distance = points[i - 1].distance + len;
|
||||
points[i].distance = geolib.getPreciseDistance(
|
||||
points[i - 1],
|
||||
points[i],
|
||||
) + points[i - 1].distance;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue