Viewer URL parameters

This page describes an older version, please read about the latest version at:
http://resources.arcgis.com/en/help/flex-viewer/concepts/

Modifying the Viewer using URL parameters

In addition to configuring the ArcGIS Viewer for Flex ("the Viewer") using configuration files, you can also identify the web map to use and specify where the map should start. These are optional settings and are not required. The config parameter allows you to switch the main configuration file, while the other parameters discussed in this topic overwrite what is specified in the map section of the main configuration file.

Specify the configuration file

Set the config parameter to any config file. It can be in the same directory, a different directory, or on a different machine. See the following code sample:

http://www.example.com/flexviewer/index.html?config=myconfig.xml
http://www.example.com/flexviewer/index.html?config=apps/myconfig.xml
http://www.example.com/flexviewer/index.html?config=http://help.arcgis.com/en/webapps/flexviewer/live/config.xml
NoteNote:

Any folder references within the configuration file will be relative to the index.html (or technically the index.swf) and not from the configuration file itself.

Specify a web map

Set the itemid parameter to an ArcGIS web map item ID that is publicly available. See the following code sample:

http://www.example.com/flexviewer/index.html?itemid=XXX

Specify where the map should start

You can specify either an extent or a center point with a map scale or specific zoom level.

If you specify a center point, you can also specify a map scale or a zoom level. The center point should be specified in the same spatial reference as your map. See the following code sample:

//Focus on Singapore
http://www.example.com/flexviewer/index.html?center=11563270,144180
// and with scale
http://www.example.com/flexviewer/index.html?center=11563270,144180&scale=250000
// or with level
http://www.example.com/flexviewer/index.html?center=11563270,144180&level=11

The extent parameter accepts a comma-separated string of xmin,ymin,xmax,ymax, similar to the space separated string used for initial and full extent properties in the <map> tag in the main configuration file. The extent should be specified in the same spatial reference as your map. See the following code sample:

// Zoom to Greater Copenhagen area
http://www.example.com/flexviewer/index.html?extent=1220000,7364000,1632000,7632000
2/15/2012