Layer List Widget: Sub-Layer Visibilty?

1996
2
09-26-2011 02:02 PM
MartinSiwek
New Contributor
Is there a way to make a layer, in the layer list widget have sub-layers visible by default?  Would this be altered in the main application configuration file or in the widget configuration file itself?  I'm using flex viewer 2.4.

Thanks
Tags (2)
0 Kudos
2 Replies
KevinHighland
Occasional Contributor II
Yes. The easiest way would be to turn layers off or on in the map document you are publishing. For example:

        <operationallayers>
   <layer label="Bluff Features" type="dynamic" visible="true"
     url="http://gisweb/internal/rest/services/Secured/Bluff_Explorer/MapServer"> 
    <sublayer id="0" popupconfig="popups/bluff_LowerArmor.xml"/>
    <sublayer id="1" popupconfig="popups/bluff_MiddleArmor.xml"/>
    <sublayer id="2" popupconfig="popups/bluff_UpperArmor.xml"/>
    <sublayer id="3" popupconfig="popups/bluff_Failure.xml"/>
    <sublayer id="4" popupconfig="popups/bluff_LargeFailure.xml"/>
    <sublayer id="5" popupconfig="popups/bluff_Notches.xml"/>
    <sublayer id="6" popupconfig="popups/bluff_Caves.xml"/>
    <sublayer id="7" popupconfig="popups/bluff_WetBluff.xml"/>
    <sublayer id="8" popupconfig="popups/bluff_LowerBluff.xml"/>
    <sublayer id="9" popupconfig="popups/bluff_MiddleBluff.xml"/>
    <sublayer id="10" popupconfig="popups/bluff_UpperBluff.xml"/>
    <sublayer id="11" popupconfig="popups/Address.xml"/> 
   </layer>


In my msd, only sublayers 8-11 are turned on, so when the application comes up, only these layers are visible.

Hope this helps.
0 Kudos
MartinSiwek
New Contributor
Kevin,

Thanks for the reply.  I apologize however, as I should have been more specific.  I'm trying to make the sub layers visible in the layer list widget within the flex viewer as can be seen in the below image.  The layer list image on the left has the layers collapsed, while in the right they are expanded by default. I'm trying to expand them by default so first time users realize that they are there.

0 Kudos