agsjs TOC Widget

665
2
Jump to solution
12-10-2012 10:46 AM
CraigMcDade
Occasional Contributor III
I'm using the agsjs TOC widget and have a service that I've added that I would like to be turned off by default when map is loaded.

I can't seem to gain control of the main "Group" checkbox. There is only one layer in my service and I've set its visible layers so that it is not checked onload, however, the group checkbox is still checked and that controls the visibility, since there is only one layer.

If that was clear as mud, I hope the pic I attached explained my issue. I'm trying to have "Sensitive Areas" off by default.
0 Kudos
1 Solution

Accepted Solutions
CraigMcDade
Occasional Contributor III
nevermind. I was seriously overthinking it. Just set visible:false when adding the layer.

View solution in original post

0 Kudos
2 Replies
CraigMcDade
Occasional Contributor III
nevermind. I was seriously overthinking it. Just set visible:false when adding the layer.
0 Kudos
TracySchloss
Frequent Contributor
I know this is an old thread - but when I try this, it didn't work as expected in the TOC.  My layers were added, with a visibility of false.  But the TOC didn't reflect this.  They showed checked as ON in the TOC, when I expected them to be unchecked.  I had to do a few clicks on/off before it was properly controlling the layers the way it should.
0 Kudos