Leaflet / Leaflet.heat

A tiny, simple and fast heatmap plugin for Leaflet.
http://leaflet.github.io/Leaflet.heat/demo
BSD 2-Clause "Simplified" License
1.55k stars 525 forks source link

Disabled layers control on MaxZoom #79

Closed Crashillo closed 7 years ago

Crashillo commented 7 years ago

I've noticed when you zoom in, exceeding the maxZoom property (set by L.heatLayer options), the layer control checkbox is disabled. Why so?

I've two heatMaps, and mainly I need to depict the data at lower zoom, in a world-wide view, and to choose between maps; but if I zoom in over than maxZoom, selection is gone. Is it a bug, or has it any reason?

chkbox-disabled

rrooij commented 7 years ago

Same problem here. It would be nice to see this fixed.

IvanSanchez commented 7 years ago

It's a Leaflet feature, not a bug. See https://github.com/Leaflet/Leaflet/pull/3694

If you have two different Leaflet layers, one for low zooms and one for high zooms, and want to enable/disable them both at the same time, create a L.LayerGroup with them, add add the group to the layers control instead.