Luuka / GPXParser.js

GPX file parser javascript library
http://luuka.github.io/GPXParser.js/
MIT License
117 stars 52 forks source link

Distance Object #32

Open sgedye opened 3 years ago

sgedye commented 3 years ago

I think that "cumul" in distance object (i.e. gpx.tracks[0].distance.cumul) returns an array of floats (or number), rather than just a single float (number).

e.g.: this:

Distance object

Property Type Description
total Float Total distance of the Route/Track
cumul Float Cumulative distance at each point of the Route/Track

should be this:

Distance object

Property Type Description
total Float Total distance of the Route/Track
cumul Float[] Cumulative distance at each point of the Route/Track
swoeste commented 2 years ago

Especially the incorrect type in the index.d.ts is somehow annoying as the type has to be overriden or casted at every usage location.

As far as I can see only the README.md and the index.d.ts need to be adjusted. If I can help out with a merge request with a fix feel free to let me know.