Hi, when using the TOC control I am having a issue with group layers which I shall try to explain:
TOC Contents Example
DynamicMapService
[INDENT]GroupLayer[/INDENT]
[INDENT][INDENT]NestedGroupLayer[/INDENT][/INDENT]
[INDENT][INDENT][INDENT]Layer 1[/INDENT][/INDENT][/INDENT]
[INDENT][INDENT][INDENT]Layer 2[/INDENT][/INDENT][/INDENT]
[INDENT][INDENT][INDENT]Layer 3[/INDENT][/INDENT][/INDENT]
[INDENT][INDENT][INDENT]Layer 4[/INDENT][/INDENT][/INDENT]
So in the example above if I update DynamicMapService.visibleLayers to include just Layer1 and Layer2 before loading the TOC then they appear checked as expected and show on the map, but neither NestedGroupLayer or GroupLayer appear checked??
So then If I add the IDs for NestedGroupLayer and GroupLayer into DynamicMapService.visibleLayers they will appear checked in the TOC, but then the map shows all layers (1, 2, 3 and 4) not just 1 and 2???? (If I then uncheck and check either NestedGroupLayer or GroupLayer the map reflects what is shown in the TOC).
Does this make sense? Can anyone point me to what I am doing wrong?
Many thanks
Tony