AnsweredAssumed Answered

Esri JS Templates - using radio buttons rather than checkboxes for layer visibility

Question asked by Natalie on Jan 25, 2015
Latest reply on Mar 30, 2015 by kenbuja

Hi,

 

I need to set up a template (such as this one) where some layer visibility is controlled by simple on/off switches (ie a checkbox - this is the default), but the visibility of certain layer pairs are held in an either-or state (ie a radio button - you turn layer B on and layer A turns off automatically, so you can never view them both at the same time).

 

There would probably be a mix of checkboxes and radio buttons in the layer list - so in the following, I can choose to see either, both or neither or Layer A and Layer B, but can only ever see one of Layer C and Layer D at a time.

 

Untitled.png

 

 

Has anyone found a way to do this using the code in a template? I'm not locked into using a particular template as this is a request I get for a lot of different situations.

Outcomes