Default Initial Layers

07-28-2011 04:43 PM
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:

    <map wraparound180="true" initialextent="-8545400 4756600 -8521300 4770200" fullextent="-8545400 4756600 -8521300 4770200" top="40" esrilogovisible="false">
            <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"
    <layer label="Comments" type="dynamic" visible="false"
            <layer label="BackgroundMXD" type="dynamic" visible="true"

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)?

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

This morning everything is working as I thought it should of in previous 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