Using web maps with the Viewer
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.
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:
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:
- Dynamically read the web map—Any changes made to the web map will be reflected in your viewer application data content source for the Viewer. You can either specify the item ID in the main configuration file or as part of the URL.
- Convert the web map to a viewer configuration file—You would do this as a starting point for aggregating data layers in a Viewer configuration file. Alternatively, the web map would be previewed with the Web Map Helper tool (see details below) to view its data contents. The Web Map Helper tool exposes the contents of the web map in XML format in a similar manner as the Viewer configuration file. You can then choose which data layers of the web map to include in your own Viewer configuration file.
Determine the item ID of a web map
- 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.
- 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: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: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:
- The web map must be accessible to the Viewer as a public item on ArcGIS.com.
- If the web map contains Bing Maps data, the Bing Maps key will need to be specified in the Viewer configuration file.