Raruto / leaflet-elevation

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

hotline and linearGradient #288

Closed hupe13 closed 7 months ago

hupe13 commented 7 months ago

Hi Raruto,

someone ask in my forum. Please see your example. Shouldn't the colors of the track and the elevation profile be the same? Why aren't they?

Thank you very much.

Raruto commented 7 months ago

Hi hupe, if I recall correctly I don't think anyone else has ever dived into that code but me: https://github.com/Raruto/leaflet-elevation/pull/257#discussion_r1200109451

The color mismatch could be due to a different approximation used by leaflet to print its paths on the map. For overall performance the map should print fewer points depending on the current zoom level (unlike leaflet-elevation chart which always displays all of them).

As usual, anyone who wants to investigate is welcome.

👋 Raruto

hupe13 commented 7 months ago

Thank you very much for your explanation.