From the example: http://gmaps-utility-gis.googlecode.com/svn/tags/agsjs/latest/examples/toc.html ,
I added
autoToggle: false //whether to automatically collapse when turned off, and expand when turn on for groups layers. default true.
in the TOC layer's code. However, in my application, this function does work.
Besides, how to set the layer as checked-off initially in the TOC?
Thanks if you can help.
Solved! Go to Solution.
To have a layer show up as collapsed in the TOC, set its visibility to false once its loaded. Here's an example
layerDynamic = new ArcGISDynamicMapServiceLayer(yourURL, { id: 'Dynamic' }); layerDynamic.on("load", function () { layerDynamic.setVisibility(false); })
To have a layer show up as collapsed in the TOC, set its visibility to false once its loaded. Here's an example
layerDynamic = new ArcGISDynamicMapServiceLayer(yourURL, { id: 'Dynamic' }); layerDynamic.on("load", function () { layerDynamic.setVisibility(false); })
Thanks a lot.
Of course, it's easier to just the layer's visibility to false when you create it. I should have suggested that first...
layerDynamic = new ArcGISDynamicMapServiceLayer(yourURL, { id: 'Dynamic', visible: false });
Thanks a lot.