Select to view content in your preferred language

Layer List Flex 2.0

1359
7
09-17-2010 09:16 AM
MelissaJohnson
Frequent Contributor
I am trying to get my Layer List working properly and have run into a problem.  My dynamic map service has several group layers.  When they come up in the Layer List the levels are not working as I would expect.
For example, if I turn on a group level (for example Water Utility, all of the layers for levels under that (even those in other groups) turn on.  How do I fix the grouping levels so that they follow the way they are in the mxd.  When I turn on Water Utility, I want the only the levels turned on by default in the map service to turn on and the user can check those not on by default if they want additional layers on.
When I uncheck the group, the layers stay on???
Also how many grouping levels with the Layer List support? 
Any insight would be appreciated!
Thanks,
Melissa
Tags (2)
0 Kudos
7 Replies
JoshuaCoates
Deactivated User
Melissa,

Where you have the operational layer listed under <operationallayers> after your type and visible ="value" add visiblelayers="use the layer id from your rest/services/layer) here is an example of what it would look like:
<layer label="2007 Bartow Floodplain" type="tiled" visible="false" visiblelayers="1,3,4"
                   url="http://publicgis/PublicGISserver/rest/services/2007_BartowFloodplain/MapServer"/>
0 Kudos
JoshuaCoates
Deactivated User
Melissa,

Where you have the operational layer listed under <operationallayers> after your type and visible ="value" add visiblelayers="use the layer id from your rest/services/layer) here is an example of what it would look like:
<layer label="2007 Bartow Floodplain" type="tiled" visible="false" visiblelayers="1,3,4"
                   url="http://publicgis/PublicGISserver/rest/services/2007_BartowFloodplain/MapServer"/>
0 Kudos
MelissaJohnson
Frequent Contributor
I may not have stated the problem well...it is difficult to describe.

I want all of my layers to be visible in the layer list and want them to stay in the Groups I set up in the mxd, so if I turn on and click the arrow to expand the Water Utility Group, and only Manholes are checked, that is the only layer that should come on. 

The way it is behaving now, when I check to turn on the Water Utility group, a check is showing up in all of the layers in that group instead of that action just turning on the ones in that group that are checked by default in my map service.  That action of checking any group layer is also causing all other sub-layers within the Group layers that are set to be on by default to turn on (it is respecting those layers default on/off settings).  Its as if it were ignoring the Group status of being unchecked completely.

I am wondering how many group layers and grouping levels you can use in the layer list (either in the MapSwitcher Widget or in the LayerList Widget and if there is some way to make them follow the levels set in the mxd.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Melissa,

   You do not have anything configured incorrectly... That is just the way that the TOC control has worked every since Tom Hill created back in 2008. The TOC component is a difficult animal to understand (as far as it's code) so you are just stuck with the way it works. Talking to the API Team they have no plans to update this code or change it's functionality.
0 Kudos
MelissaJohnson
Frequent Contributor
Good to know it isn't just me this time.  I would think the ability to keep group levels in the layer list would be very basic functionality users would need.  Too bad...
Thanks as always!
Melissa
0 Kudos
DaveMeyer
New Contributor
Melissa,

I'm having the exact same problem. If you come up with a workaround or solution, let me know.

-DM
0 Kudos
MelissaJohnson
Frequent Contributor
No I haven't found a solution yet.  My workaround for now is to revamp my mxd with no group layers.  I plan on coming back to it when I get some other issues worked out. 

Melissa
0 Kudos