Default Initial Layers

614
1
07-28-2011 04:43 PM
ScottAndreasen
New Contributor
Hi, I have Bing Maps as a background in the Flex Viewer and I would like to have specific layers from my REST services turned on as the Viewer is loaded.

I thought, perhaps, the default layers of the Map Services (ie. The layers turned on when MXD is converted to MSD) would automatically be on. This appears to be true, except the entire service is turned off initially. The group of layers still needs to be checked on in order for custom data to be displayed.

I hoped that visible="true" would do the trick, but it doesn't seem to be working.

Here is the code from the config file. I'm trying to get the BackgroundMXD to turn on by default:

[INDENT][INDENT]
    <map wraparound180="true" initialextent="-8545400 4756600 -8521300 4770200" fullextent="-8545400 4756600 -8521300 4770200" top="40" esrilogovisible="false">
        <basemaps>
            <layer label="Streets" type="bing" visible="true" style="road" culture="en-US" />
            <layer label="Aerial" type="bing" visible="false" style="aerial" culture="en-US" />
            <layer label="Aerial with Labels" type="bing" visible="false" style="aerialWithLabels" culture="en-US" />
            <layer label="Natural BG"    type="tiled" visible="false"
                   url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer"/>
        </basemaps>
        <operationallayers>          
    <layer label="Comments" type="dynamic" visible="false"
                   url="http://XXXXXXX:8399/arcgis/rest/services/LCIMRL/LCIMRL-Comments/MapServer"/>
            <layer label="BackgroundMXD" type="dynamic" visible="true"
                   url="http://XXXXXXXX:8399/arcgis/rest/services/LCIMRL/BackgroundMXD/MapServer"/>
        </operationallayers>
    </map>[/INDENT][/INDENT]

Can custom data be turned on initially? If yes, do I do it here in the config file, or in one of the widgets (ie. LayerList or MapSwitcher)?

Thanks
Tags (2)
0 Kudos
1 Reply
ScottAndreasen
New Contributor
I think I might have wasted your time.

This morning everything is working as I thought it should of in previous post...it might not have been working yesterday because maybe I forgot to clear the REST Cache, or maybe my local internet connection was being slow and I wasn't being patient enough.

No problems now.
0 Kudos