{ layer: altmaps, slider: true, title: "OS Basemaps", isopen: false }
if (this.data._subLayerInfos) { //acm added to collapse groups at the start this.toggler.hide() //end acm addition
//ACM also changed this line to get groups initial expand set //dojo.addClass(this.iconNode, a ? "dijitTreeExpandoOpened" : "dijitTreeExpandoClosed") dojo.addClass(this.iconNode, a ? "dijitTreeExpandoClosed" : "dijitTreeExpandoClosed")
var toc = new agsjs.dijit.TOC({ map: map, layerInfos: [{ layer: safety, title: "Safety Operations", collapsed: true },{ layer: census, title: "Census", collapsed: true }] }, 'tocDiv'); toc.startup();
Is there any way to have the map service layer initially expanded but all collapsible groups within the map service (unique value renderers and group layers) collapsed?
This method did not work for me!
ok - cracked the code to get all groups collapsed - as in screenshot
[ATTACH=CONFIG]18426[/ATTACH]
In the postcreate function find and alter as belowif (this.data._subLayerInfos) { //acm added to collapse groups at the start this.toggler.hide() //end acm addition
and a bit later//ACM also changed this line to get groups initial expand set //dojo.addClass(this.iconNode, a ? "dijitTreeExpandoOpened" : "dijitTreeExpandoClosed") c
So far it appears to work. The second part could be neater, but doing it this way you can see it has been changed to always return "dijitTreeExpandoClosed"
ACM