Layer list widget: disable child layers when the parent layer is not selected

3299
3
12-10-2013 05:28 AM
YohanBienvenue
Occasional Contributor II
Hi,

I'd like to know if it's possible to disable layers (in the layer list widget) who's layer group is not selected. Such layers are not visible in the map, but are still visible and enabled in the layer list widget. I know it's trivial, but sometimes users are confused that a layer is not visible, they don't notice the group layer is not selected. Here is an example in our application:

[ATTACH=CONFIG]29716[/ATTACH]

I know that when a layer is out of range for it's defined scale, it will become disabled. This makes it clear that the layer is not visible in the map.

[ATTACH=CONFIG]29717[/ATTACH]

I'm a software developer not a GIS specialist, so I don't know if this behavior is standard or not. Still, I'm wondering if there's a way to get the same behaviour for disabled group layers as for out of range layers?

Thanks
3 Replies
by Anonymous User
Not applicable
Original User: goldenlimit

Hello Yohan,

This is Nathan again, I saw your new post here.
For the question you asked, I agree that there might some confusion to users when group layer is not selected but the child layer still checked. However, I would like to say in a more high-level of the way to identify the issue.
For example, if when have a layer layout like this:

-Layer A
  --Sub layer 0
  --Sub layer 1
  --Sub layer 2

If we turn the group layer A off, none of the sub layer can choose any more. But if the user only want to see the sub layer 0, they can't see it any more because we turn off the group layer A. Therefore, although it is a good idea to turn off the group layer to eliminate confusion, however, this way of setting will disable the sub layer option if some users only want to see one of the sub layers under the group layer.

To this point, I recommend two possible solution about this issue:
1. Rethinking about the way of layer construction, if the user more like to turn on the sub layer instead of the turn on the group layer. Why not switch a new location of the sub layer.  

2. We can turn off some group layers options directly from the layer list widget in order to decrease the confusion.
Here I attach a documentation about layer list widget configuration:
http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Layer_List_widget_tag/01m300000...   

Hope this can help.
0 Kudos
YohanBienvenue
Occasional Contributor II
Hi Nathan,

Reading your post you made me realize that yes, if I take a step back and think about it, it might make more sense to just enable the group layer by default, and instead disable the sub-layers that should not be visible initially. Then if the user wants to see a specific sub-layer under that group, he/she can check that sub-layer.

It makes it less likely that a user will be confused since he/she will have to uncheck the group layer themselves to have this issue happen.

Of course I would prefer to also have the sub-layers disabled (visually, like in the 2nd image) if the group layer is unchecked, which is my question. However I think the suggestion above is better then what we have now, so I'll do this as least.

Thanks again Nathan
0 Kudos
by Anonymous User
Not applicable
Original User: ad_giles@hotmail.com

Yohan,

I got round this issue by adding a bit of code that turns on all parents of a child when selected. The code is here:

http://forums.arcgis.com/threads/69574-how-to-turn-on-a-group-layer-when-a-sublayer-is-turned-on-in-...

Regards

Anthony
0 Kudos