Raruto/leaflet-elevation

How to show Elevation in decimal?

mdfaisalpapa opened this issue · 3 comments

The elevation is shown in whole numbers for example 0.67 is shown as 1m . How to show the same with the actual value instead of rounding off?

Hi @mdfaisalpapa,

  1. the simple way:

decimalsX: 2,
decimalsY: 0,

  1. the nerd way: #216 (comment)

  2. for everything else, write a your own custom handler:

handlers: [ // <-- A list of: Dynamic imports || "ClassName" || function Name() { return { /* a custom object definition */ } }
'Distance', // <-- same as: import("../src/handlers/distance.js")
'Time', // <-- same as: import("../src/handlers/time.js")
'Altitude', // <-- same as: import("../src/handlers/altitude.js")
'Slope', // <-- same as: import("../src/handlers/slope.js")
'Speed', // <-- same as: import("../src/handlers/speed.js")
'Acceleration', // <-- same as: import("../src/handlers/acceleration.js")
// 'Pace', // <-- same as: import("../src/handlers/pace.js")
// "Heart", // <-- same as: import("../src/handlers/heart.js")
// "Cadence", // <-- same as: import("../src/handlers/cadence.js")
// import('../src/handlers/heart.js'),
import('../src/handlers/cadence.js'),
// import('../src/handlers/pace.js'),
L.Control.Elevation.MyHeart, // <-- see custom functions declared above
// L.Control.Elevation.MyCadence, // <-- see custom functions declared above
L.Control.Elevation.MyPace, // <-- see custom functions declared above
],

👋 Raruto

Thank you.