Select to view content in your preferred language

Layers not showing

2787
5
01-04-2011 05:18 PM
ShaunWebb
Emerging Contributor
Hi,
I have recently downloaded the Flex Viewer and cannot get different layers from my ArcGIS service to show in the viewer. The only way that I can view a layer is if it is the only layer in the service. If I add /2 or /3 under the operational layer tag, none of these layers are shown in the map, even though they are available to turn on under the "more" option.
Tags (2)
0 Kudos
5 Replies
JonFisher
Emerging Contributor
Hi,
I have recently downloaded the Flex Viewer and cannot get different layers from my ArcGIS service to show in the viewer. The only way that I can view a layer is if it is the only layer in the service. If I add /2 or /3 under the operational layer tag, none of these layers are shown in the map, even though they are available to turn on under the "more" option.


If you want all of the layers in your map service to be accessible to be turned on or off, you should just use the URL that ends in /MapServer rather than the one pointing to the specific layer (e.g. /MapServer/0). If you specify a particular layer in the URL, only that layer will be shown.
0 Kudos
ShaunWebb
Emerging Contributor
Hi, If I specify the URL as /Mapserver in the <operationallayers> all the layers in service show on the map.  How would I turn individual layers on and off?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shaun,

   You can use the more button on the map switcher widget or the layerlist widget if you are talking about run time changes if you want to set the visible layers in code then you would use visibleLayers property.
0 Kudos
JonFisher
Emerging Contributor
Hi, If I specify the URL as /Mapserver in the <operationallayers> all the layers in service show on the map.  How would I turn individual layers on and off?


For more details on what Robert is talking about, see:
http://help.arcgis.com/en/webapps/flexviewer/help/layer_tag.htm

Note that the visiblelayers attribute will only work for a dynamic, WMS, or arcims map service type.
0 Kudos
ShaunWebb
Emerging Contributor
Thanks, using visiblelayers fixed the problem.
0 Kudos