Raruto / leaflet-elevation

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

How to show Elevation in decimal? #277

Closed mdfaisalpapa closed 10 months ago

mdfaisalpapa commented 10 months ago

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?

Raruto commented 10 months ago

Hi @mdfaisalpapa,

  1. the simple way:

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/src/options.js#L79-L80

  1. the nerd way: https://github.com/Raruto/leaflet-elevation/pull/216#issuecomment-1296356245

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

https://github.com/Raruto/leaflet-elevation/blob/bd9316bd1b7e7784b3bf3d812960eaa808ad94d6/examples/leaflet-elevation_extended-ui.html#L255-L271

👋 Raruto

hupe13 commented 10 months ago

My solution as an example: https://github.com/hupe13/extensions-leaflet-map-github/blob/bdf6aa9f0c529328baa2bc8423a7c85984718e5c/js/elevation.js#L20-L97

Maybe this helps.

mdfaisalpapa commented 10 months ago

Thank you.