leaflet-panel-layers icon indicating copy to clipboard operation
leaflet-panel-layers copied to clipboard

Allow an Overlay group to use radio buttons

Open brentfraser opened this issue 6 years ago • 3 comments

For example, allow by adding an option to the group definition: radio: true, Or some other reasonable keyword.

Note that similar functionality has been implemented in the (now stagnant) leaflet-groupedlayercontrol, although they used an array of group names:

exclusiveGroups: ["Landmarks"]

image

Related to #39

brentfraser avatar Nov 20 '19 15:11 brentfraser

I've done a fork and am in the process of enhancing the code. A couple of limitations:

  1. It groups the radio buttons on Group Name. So the Group Name should be unique.
  2. If multiple layers in the group are set to active in the definition, they will all be displayed on the map, but only one radio button will be selected. Not good.

brentfraser avatar Nov 20 '19 18:11 brentfraser

image

brentfraser avatar Nov 20 '19 19:11 brentfraser

addresses #39

brentfraser avatar Apr 07 '20 14:04 brentfraser

added new options exclusiveGroup solved in version 1.2.8 demo online here: https://opengeo.tech/maps/leaflet-panel-layers/examples/group-layers-exclusive.html

stefanocudini avatar Nov 16 '22 22:11 stefanocudini