Using web maps with the Viewer

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

ArcGIS.com is an Esri web site for working with maps and other types of geographic information. Visit the site to create maps; find and use maps, applications, and tools; and share your maps and applications with others. Within the site, you will find applications for building and sharing maps. You will also find useful basemaps, data, applications, and tools that you can view and use, plus communities you can join. Learn more about ArcGIS.com and its capabilities in the ArcGIS.com help.

Screen shot of the ArcGIS.com home page

As used in this topic, the term "web map" refers to a map that is created, stored, and available on ArcGIS.com or an ArcGIS Portal. A web map can be analytic, collaborative, static, dynamic, interactive, and/or temporal. The purpose of web maps is to enable the sharing and collaboration of geospatial information, and its associated data, in an easy and understandable way.

ArcGIS.com offers a gallery of web maps that can be used with the ArcGIS Viewer for Flex ("the Viewer"), as well as other types of maps and data such as map services, map packages, layer packages, and presentations. Check out the Web map gallery:

Screen shot of the ArcGIS.com Gallery page

Adding a web map to the Viewer

The Viewer works with web maps by using their data contents to populate the <map> tag of the Viewer application configuration file (for example, config.xml) by referencing the web map's item ID value for the itemid attribute of the <map> tag. See the Main configuration file topic for details. The two approaches for working with a web map from ArcGIS.com are as follows:

Determine the item ID of a web map

  1. View the web map in one of the ArcGIS.com viewer applications in a web browser, either the ArcGIS.com Viewer or ArcGIS Explorer Online.
  2. Observe the URL address of the opened web map in the web browser. Note the last portion of the URL address is denoted by "... webmap=<some_unique_value_string>. See the following screen shot:
    Screen shot of the ArcGIS.com Viewer with the item ID highlighted
    In the graphic above, the URL address for the Web map is http://www.arcgis.com/home/webmap/viewer.html?webmap=2f1d4a31078d460aa4a7aa46f5b882e5. The item ID is the web map value (in this example, 2f1d4a31078d460aa4a7aa46f5b882e5).

Use the item ID of the web map

Approach 1 Option A—Use itemid in the configuration file
<configuration>
   ...
    <map itemid="2f1d4a31078d460aa4a7aa46f5b882e5">
    </map>
   ...
</configuration>
Approach 1 Option B—Use itemid in the URL
http://www.example.com/flexviewer/?itemid=2f1d4a31078d460aa4a7aa46f5b882e5
Approach 2—Convert the web map to config.xml
Use the Web Map Helper tool to convert the web map information to a configuration file. This application is available on the ArcGIS Viewer for Flex Resource Center, under the Concepts tab. It takes a web map's item ID (or URL address) and converts its data contents to XML format, in a similar manner as the Viewer configuration file. See the following screen shots:
Screen shots showing the conversion from a web map to a config.xml file
The resulting XML code that is shown under the Config XML tab of the application can be used within a Viewer application configuration file (for example, copying the <layer> tag reference to access and use the specified basemap or operational layer within your own Viewer application).

Considerations when using ArcGIS.com web maps

Before enabling the Viewer to work with a web map, consider the following:

See Common questions for more information about ArcGIS.com.

2/15/2012