mpetazzoni / leaflet-gpx

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

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

Closed cavEpfl closed 2 years ago

cavEpfl commented 2 years 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.