In a TOC panel, there are several Operational Layers, each one has a checkbox. I added these layers by the piece of code below:
var sliderTOC = new agsjs.dijit.TOC({
map: map,
layerInfos: [{
layer: operational1,
title: "by Site",
noLayers: true
}, {
layer: operational2,
title: "by Zip",
noLayers: true
}, {
layer: operational3,
title: "Distribution",
noLayers: true
}], style: 'inline'
}, 'sliderDiv'); sliderTOC.startup();
Initially, one of the feature layer is on and others are off, I want to add a such a function that when I click one of the checkbox, this layer is on and other layers are off.
Where and how can a piece of code be added to implement this function? Thanks for your help.
Take a look at this post. It shows how to have only one layer on at a time.