mpetazzoni / leaflet-gpx

A GPX track plugin for Leaflet.js
http://mpetazzoni.github.io/leaflet-gpx
BSD 2-Clause "Simplified" License
529 stars 114 forks source link

Bug fix, placed distance increment before assignment to points #137

Closed cavEpfl closed 1 year ago

cavEpfl commented 1 year ago

One has to first increment the 3D distance before assigning it to the points. When you graph short gpx files you will directly see that the last distance is never incremented and that each distance value does not correspond to the correct elevation value. Placing the increment above assignments of _info.length corrects this issue.