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

Toggle with a button the gpxGroup legend #243

Closed haldo98 closed 1 year ago

haldo98 commented 1 year ago

Hi

is there a way to toggle with a button the legend (true/false) in the gpxGroup ?

Raruto commented 1 year ago

If you are referring to this library:

https://github.com/Raruto/leaflet-elevation/blob/868179234d8e9b8f7beaea57d0e34d8bd79a2622/libs/leaflet-gpxgroup.js#L1-L341

I don't think out of the box (but I don't know, it's code that I don't read every day...), but with some custom JS you can do just about anything.

👋 Raruto

haldo98 commented 1 year ago

I found that setting to true the collapsed option pretty much solved my problem.

I have a page with 117 tracks and the list of the track was covering much of the space

https://github.com/Raruto/leaflet-elevation/blob/868179234d8e9b8f7beaea57d0e34d8bd79a2622/libs/leaflet-gpxgroup.js#L108-L112

Thank You