Raruto / leaflet-elevation

Leaflet plugin that allows to add elevation profiles using d3js
GNU General Public License v3.0
255 stars 85 forks source link

Add custom labels and track duration inside chart tooltip #169

Closed velocat closed 2 years ago

velocat commented 2 years ago

label

Raruto commented 2 years ago

Hi velocat,

I changed the code a bit, if possible I would prefer to avoid adding too many ambiguous or specific options (there are already too many things called "label"...), however for the moment I was thinking of such a thing:

L.registerLocale('en', {

  ...

  "y: "  : "Altitude: ",
  "x: "  : "Distance: ",
  "t: "  : "Date: ",
  "T: "  : "Duration: ",
  "m: "  : "Slope: ",
  "v: "  : "Speed: ",
  "a: "  : "Acceleration: ",

});

L.setLocale('en');

Maybe it won't be THE definitive solution, but who really knows ...

For other things, you can play with the following options:

time: true || "summary" || false,
timestamps: true || false,
timeFormat: "date" || "time", || function /* experimental option: not yet documented... */

Happy testing, Raruto

Raruto commented 2 years ago

Patch released in version 1.7.6