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)
|
for (let i = 1; i < points.length; ++i)
|
||||||
{
|
{
|
||||||
const len = geolib.getPreciseDistance(
|
points[i].distance = geolib.getPreciseDistance(
|
||||||
...[points[i - 1], points[i]]
|
points[i - 1],
|
||||||
.map(({lat, lon}) => ({
|
points[i],
|
||||||
latitude: lat,
|
) + points[i - 1].distance;
|
||||||
longitude: lon
|
|
||||||
})),
|
|
||||||
);
|
|
||||||
|
|
||||||
points[i].distance = points[i - 1].distance + len;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue