Leaflet elevation get track properties (Length, Elevation, time, etc)
cesar2 opened this issue · comments
Subject of the issue
Is there a way to get the track properties in a similar way it can be done with leaflet-gpx from javascript?
Like:
get_distance()
: returns the total track distance, in metersget_start_time()
: returns a Javascript Date object representing the starting timeget_end_time()
: returns a Javascript Date object representing when the last point was recordedget_moving_time()
: returns the moving time, in millisecondsget_total_time()
: returns the total track time, in millisecondsget_moving_pace()
: returns the average moving pace in milliseconds per kmget_moving_speed()
: returns the average moving speed in km per hourget_total_speed()
: returns the average total speed in km per hourget_elevation_min()
: returns the lowest elevation, in metersget_elevation_max()
: returns the highest elevation, in metersget_elevation_gain()
: returns the cumulative elevation gain, in meters
Thanks a million
Your environment
- leaflet-elevation: Latest
- leaflet: 1.9.4
- browser: chrome
- operating system: win10
var map = new L.Map('map');
var controlElevation = L.control.elevation(options).addTo(map);
controlElevation.load("https://raruto.github.io/leaflet-elevation/examples/via-emilia.gpx");
controlElevation.on('eledata_loaded', ({ track_info }) => { console.log(track_info.distance + " km"); });