MG1986

Setting layer visibility using an onClick event

Discussion created by MG1986 on Nov 29, 2012
I have a school project where I am trying to alter the visibility of certain layers when people click on various parts of an accordion
pane in my application.  I have it set up to where when an accordion pane panel is clicked, the ID of that panel is recognized and it will reference the updateLayerVisibility function I am trying to get to work. My question, is how do I get the updateLayerVisibility function to recognize the array of layers IDs I have set for by a variable in the function I have that recognizes the clicking of a certain accordion pane panel?

The updateLayerVisibility function I am trying to get to work can be found here, under map and then toggling layer visibility.

Outcomes