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

Feature Request - Temperature #205

Closed sjdellis closed 2 years ago

sjdellis commented 2 years ago

Hi there

Great project! Would it be possible to add Temperature ? My GPX looks like this.

`<?xml version="1.0" encoding="UTF-8"?>

name Day 1 2.52 24.6 `.... Thanks
Raruto commented 2 years ago

Hi simi.d,

I think so, try to take a look at the source code of leaflet-elevation_extended-ui.html example to understand how to proceed. If you need some inspiration, here you can see how the other default handlers of this library actually work: src/handlers

As usual, pull requests are always welcome.

Have a nice day, Raruto

sjdellis commented 2 years ago

Thank you Raruto. Those a fantastic examples. I'm not really a developer but I've managed to get the temperature to work. I'm not familiar with git/github - that is next on the list of things to learn :)

Attached is my temperature handler if it is any use to you. One thing I cannot figure out is how to get the average to ignore null data. It seems to set it to 0. The chart also draws a line at 0 when there is null data. I'll keep digging unless you can point me in a direction.

temperature.zip