ol-layerswitcher icon indicating copy to clipboard operation
ol-layerswitcher copied to clipboard

Non base layer group with radio buttons

Open kennethhaspeel opened this issue 5 years ago • 2 comments

As it is now, the base layer group gets radio buttons. Other layer groups get checkboxes. But i would prefer that the user can only select one layer at a time, so with radio buttons. Is this possible? I tried setting the optional layers as base layer but that just controls all base layers, not just the layers in that group. I could add a dropdown outside of the map and toggle visibility but it's for use on mobile devices so screen real estate is limited. And i prefer everything to be focused on the map. I'm pretty sure this is just an option somewhere that I don't know about

Something like this image

kennethhaspeel avatar May 27 '20 07:05 kennethhaspeel

I'm not in front of my laptop ATM so can't test but have you tried setting type of the layers to base?

walkermatt avatar May 27 '20 12:05 walkermatt

That is what i meant with "I tried setting the optional layers as base layer but that just controls all base layers, not just the layers in that group". I assumed it would work like this but it doesn't. I set all the layers to base. This sets the name attribute of the inputs to base. So all the layers are in one radio group and not in radio groups by layer groups Initial image Click layer image Hope this explains it better than my first attempt. I want the user to be able to select a base layer (not sure if that's the correct term) and then select one detail layer

kennethhaspeel avatar May 27 '20 12:05 kennethhaspeel