I'm using MapBox GL API for Qt (JavaScript), and I have to get the total distance and total duration from a route. To obtain the route, I'm making the following http request:
The response is in geoJSON format, which I use to draw the route on my map, and it works.
The problem is I can't calculate the total distance and duration of the whole trip. There are many "duration" and "distance" fields in this geoJSON.
Do I have to work with these multiple fields, or is there any other way to calculate the total distance and duration?