0

I'm using portalItem to display a web map in a web page and the Layer List widget to control the layer display. I want to show one layer at a time using radio buttons, instead of having to click on the eyes to turn off one layer and turn on another.

Layer List widget

Does ArcGIS API for JavaScript have the option? I'm using version 4.8.

1 Answer 1

1

The Layer List can show radio buttons (see this example), but this is something that's built into a web scene designer, where you can change the group type from CheckBox to Radio. See this scene as an example. Unfortunately, this doesn't seem to be an option in a web map

2
  • 1
    @kenbujia It seems like to be this case in web map. Looks like putting feature layers into group layer is the only way to have the radio button.
    – PacmanKX
    Commented Jul 24, 2018 at 2:29
  • Correct. The radio buttons (aka visibilityMode=exclusive) is a feature of a group layer. Web map specification doesn't yet support group layers (but WebScene specification and JSAPI 4 does). developers.arcgis.com/javascript/latest/api-reference/… Commented Jul 30, 2018 at 18:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.