Select to view content in your preferred language

TOC and Group Layer issue!?!

473
1
05-11-2011 06:36 AM
TonyCollins
Occasional Contributor
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
Tags (2)
0 Kudos
1 Reply
TonyCollins
Occasional Contributor
Not sure if you can understand what I am saying above, but I am setting these values from code, not clicking in the TOC..

Any direction would be much appreciated and I am happy to describe this in more detail if needed??

Thanks
0 Kudos