diff --git a/back/data/network.js b/back/data/network.js index 591c04e..df418da 100644 --- a/back/data/network.js +++ b/back/data/network.js @@ -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; } }