Select to view content in your preferred language

Sublayer in TOC

1100
8
04-12-2011 05:31 AM
CynthiaMatney
Emerging Contributor
Hello.  I have been trying to figure out how to group layers and then make them visible in the TOCWidget.

Ex:  In my map services I have a layer called "School Boundaries" and then I have 4 sublayers under that "Elementary School", "Middle School", "Jr High School" & "High School".

I would like to have the TOC show "School Boundaries" and give me the option to click that and below that it will show the 4 sublayers and give me the option to click those on individually.  I know it can be done as I see it on other's websites - but not sure what I'm doing wrong.

Thanks for your help!
Cynthia
Tags (2)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
Cynthia,

   They have to be grouped in the ArcMap Document.
0 Kudos
CynthiaMatney
Emerging Contributor
I have them grouped in ArcMap - but not sure how to get them grouped on the TOC...
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Hmm... If they are grouped in ArcMap than they would appear as a group in the TOC Widget.
0 Kudos
CynthiaMatney
Emerging Contributor
Is there a special way that I need to put them into my config.xml file in order for them to viewed as layer-sublayer?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Cynthia,

   Maybe we are speaking of two different things... There is nothing you would have to do to have it appear as a group in the TOC if it is grouped in ArcMap. Unless maybe you have not cleared the REST Cache so that the map service sees your change.
0 Kudos
CynthiaMatney
Emerging Contributor
Yes, the REST cache has been cleared - so that should not be the issue. 

Do I need to have my operational layer(s) in the config.xml a certain way? 

For Example:  Do I put the layer and each sublayer as separate operational layers or do I just need to list the layer?

Thanks.
0 Kudos
EricVenden
Frequent Contributor
Cynthia,
You should just have to put the map service name in the operational layers list...I believe this should be case if you are using an image Map Service...My TOC works as it should with grouped layers.  All I had to do was arrange the published mxd (or msd) and then insert the map service name in the config file.

Eric
0 Kudos
CynthiaMatney
Emerging Contributor
Ah - that is what I wasn't doing...I wasn't putting the whole map service in the operational layers...I was putting individual features from the map service w/in the operational layers.  Now that I put the whole map service in it shows the layers w/sublayers.  Thank you.

Although I have a question (imagine that) - so when I used the individual features of the map service in the operational layers I was able to have a particular infowindow hooked to it (ie: elementary school - could click on map and the name and info of that particular elementary school would come up).  So, if all the features are all grouped in the one map service (layers include 4 different school layers, parks, ems layers, ward layers, etc) - am I able to hook an individual infowindow to each of those features to get information for each or do I have to do something different?

Does that make sense?
0 Kudos