Simple Sublayers

1548
4
02-15-2011 07:17 AM
GarrettMoeller
New Contributor III
Greetings,
As I have just begun using the FLEXViewer, I have a simple sublayer setup that I am trying to do.
I have my mapservice...
After going to my http://host/ArcGIS/rest/services/samplemapservice/MapServer page, I am able to see the multiple layers that I have along with the associated sublayers....each with a corresponding number.

So, The goal is to take a layer and it's sublayers and be able to interact with the layers under the "more..." tab.

First, I tried just calling upon one of the main layers (#14) which has associated sublayers.
This did not display sublayers.

Then, I tried calling the #14 main layer and calling a sublayer (#15) as separate layer tags...

This only made it so that I have two layers and no sublayers...
It seems that I am missing a sublayer tag or something...

Please, how do I add sublayers in the "more..." drop down?
Thank you
Tags (2)
0 Kudos
4 Replies
GarrettMoeller
New Contributor III
I answered my own question...
To have layers automatically show up (mirroring the setup you created in ArcMap), you have to make the type="dynamic" in the layer tag....
yay
0 Kudos
GarrettMoeller
New Contributor III
One more question regarding this....
If I set the layer type to dynamic and take away any specific numbers (referencing a particular feature), all layers show up fine including sublayers.

If I want to select only one main layer and have only its sublayers showing, however, I put in that layers reference number at the end of the string and the sublayers do not show up....

How to call a dynamic layer and get specific layers within the dynamic layer instead of the entire mapservice it calls upon....example: a layer and its sublayers but not other layers....

Thank you
0 Kudos
JonFisher
New Contributor III
One more question regarding this....
If I set the layer type to dynamic and take away any specific numbers (referencing a particular feature), all layers show up fine including sublayers.

If I want to select only one main layer and have only its sublayers showing, however, I put in that layers reference number at the end of the string and the sublayers do not show up....

How to call a dynamic layer and get specific layers within the dynamic layer instead of the entire mapservice it calls upon....example: a layer and its sublayers but not other layers....

Thank you


I think you want to refer to the entire map service for the url attribute (the one ending in /MapServer without a number), then filter out the layers you don't want.

If you are talking about the default visibility (i.e. which layers you can see when the map first opens) use the visiblelayers attribute as listed here: http://help.arcgis.com/en/webapps/flexviewer/help/layer_tag.htm. Use the format visiblelayers=�??0,1,2�?� to show the first 3 layers in a service, the numbers correspond to the layer number in REST.

If you want the other layers to not show up in the table of contents at all, you will also need to use the <excludelayer> tag in the MapSwitcher widget (or LayerList widget):
http://help.arcgis.com/en/webapps/flexviewer/help/widgets/mapswitcher_widget.htm Note that you need one <excludelayer> entry for each layer you wish to exclude, and the text you put in between the two tags must exactly match the layer name listed in the map service.
0 Kudos
GarrettMoeller
New Contributor III
Exactly what I was looking for...
Thank you!
0 Kudos