Can you use URL parameters in ArcGIS Server 10 Viewer for Flex to turn on layers?
I have had success using URL parameters to go to specific coordinates.
Can you use URL parameters in ArcGIS Server 10 Viewer for Flex to turn on layers?
I have had success using URL parameters to go to specific coordinates.
No, the compiled version of ArcGIS Viewer for Flex does not directly support using URL parameters to turn on/off layers.
http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Viewer_URL_parameters/01m300000029000000/
However, you can use URL parameters to point the application to different configuration files, and inside the configuration files you can specify particular map services, layers, etc. http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Main_configuration_file/01m300000018000000/
To set the visibility for specific layers within a mapservice (overriding the map service visibilities), use the visiblelayers property on the layer tag. For example:
<layer visiblelayer="0,2" .../>
visiblelayers - Which sublayers to show when the application first opens. The default is as specified on the server. Only applies to dynamic, arcims and wms. For WMS it is required or no sublayers will be shown.
http://help.arcgis.com/en/webapps/flexviewer/help/index.html#//01m30000000p000000.htm
I think you'd need to add a group layer of lots of layers in the map service, then turn them on and off. However, this approach, I think, means all child layers will be turned on when it is loaded as default?
Using the link above, you could choose to use the TOC or implement the layer changes otherwise. I think this is what you need isn't it?
If so then my layer urls look like this...
<layer label="CRI Wells" type="feature" visible="True"
info="widgets/InfoTemplates/SimpleInfoWinWidget.swf"
infoconfig="widgets/InfoTemplates/IWT_Watford_Wells.xml"
url="http://gismap/ArcGIS/rest/services/CRI_Well/MapServer/0"/>
Or Maybe this is the answer you are looking for...
flex api 2.3.1