ismyrnow / leaflet-groupedlayercontrol

Leaflet layer control with support for grouping overlays together.
MIT License
274 stars 141 forks source link

Add Off item for exclusive radio groups #31

Closed spydmobile closed 8 years ago

spydmobile commented 8 years ago

Lets say you have a group that is exclusive, but you want it to have a none option. there is no good way to do this without throwing errors.

jdoblas commented 8 years ago

I'm with spydmobile on this one, it will be quite helpful to have at least a toggle button next to the exclusive group name.

ismyrnow commented 8 years ago

Ah, a limitation of radio inputs. You could probably create an empty layer group to act as your none option. For example:

var noneLayer = L.layerGroup();

I haven't tried this, but I don't suspect it will throw an error.