Many map layers in ArcGIS are used for accessing rich attributes and other information for each feature. One mechanism is to provide an HTML pop-up display when you click on each feature. This potentially provides a powerful way to share HTML-formatted information, such as web content, about each feature.
HTML pop-up windows enable users to access formatted content, including web-based content, such as graphics referenced by URLs, by clicking on features on the map. They are especially useful for layers that you will be sharing with other users as packages so that they can access richly formatted information about features when they open your package in ArcGIS for Desktop or ArcGIS Explorer Desktop. They are also used if you share your data with others as KML. Finally, the HTML pop-up definition is also served with your map if you serve it using ArcGIS for Server, and they can be accessed by people using your map service in certain web applications and desktop clients such as ArcGIS for Desktop and ArcGIS Explorer.
You can display HTML content about features in ArcMap, ArcGlobe, or ArcScene using HTML pop-up windows. To do this, you'll first set the HTML display properties for a feature layer. Once you have defined what to display, you can click a feature with the HTML Pop-up tool to open a window containing the HTML content.
HTML pop-up windows work much like the Identify tool, except the information display can be formatted in HTML.
Setting the properties of an HTML pop-up display
You use the Layer Properties dialog box to define HTML pop-up properties for a layer. Follow these steps:
- Right-click the layer to open the Layer Properties dialog box and click the HTML Popup tab.
- Check the Show content for this layer using the HTML Popup tool check box.
- Choose the option for the type of HTML display you would like to use. You have three options as shown here: The next section has more information on setting each option.
- Check the Display coded value description in all HTML content check box if you want the attribute values that are based on coded value domains to be displayed in HTML pop-up windows with their full description, such as 'Wide plastic pipeline' instead of their coded value.
- To verify that your HTML content will display as you want it to, click the Verify button.
Types of HTML content you can display
As a table of the visible fields
The default HTML pop-up window for a feature layer has an HTML table containing the names and values of the layer's attributes (below).
You can set your field visibility, the order in which fields appear, field alias names, and other properties on the Fields tab of the Layer Properties dialog box.
Using a display expression—As part of using visible fields, you can optionally build a display expression that will be used in your HTML pop-up window. For example, you can build a display expression for counties that include the county name, state name, and population from fields in your feature attribute table. This display also includes three visible fields—POPDENSITY, MALE, and FEMALE—which are displayed using their field aliases.
Use the Display tab on your Layer Properties dialog box to build the display expression. Click the Expression button to display the Display Expression dialog box and create a display expression.
Including feature class attachments—When using the option to display HTML pop-up windows as a table of visible fields, feature class attachments will be displayed automatically as part of the pop-up window. For example, a number of pictures, documents, and other attachments can be added to a feature class. These attachments will be included as part of the HTML pop-up window.
Displaying images from file paths—If you have a field in your layer's attribute table that contains file paths to images, you can modify the value of the field so that the image automatically displays in the pop-up. You can do this by using the HTML image tag:
<img src='C:\DATA\Images\PICTURE1.jpg' width='250' />
As a URL
HTML pop-up windows can display the contents of a URL accessed over the Internet. The most common use of URLs is to reference HTML pages. The attribute value supplied from one of the layer's attributes becomes part of the URL expression. In the example below, this option is used to specify that the pop-up window will contain the Wikipedia entry for a place-name supplied by the attribute field. The city name value is returned as a property when a user clicks on a feature in the map display using the HTML Popup tool.
This city name field is one of the HTML pop-up properties that you would set for the city layer.
When using this option, you can think of it as being like you would build an expression. The expression in this case is simple: Prefix + Field + Suffix = Complete URL.
Example 1: If you defined the prefix as http://training.esri.com/gateway/index.cfm?fa= and selected a field with an example value of catalog.gateway, the HTML Pop-up tool would combine the prefix with the field value to create the URL http://training.esri.com/gateway/index.cfm?fa=catalog.gateway. No Suffix in this example is required to complete the URL.
Example 2: If you defined the prefix as http://training.esri.com/gateway and selected a field with an example value of index, you would also need a suffix to complete this URL. For this URL, the suffix is .cfm. The complete URL would be http://training.esri.com/gateway/index.cfm.
As a custom pop-up window
This option is a formatted page based on an Extensible Style Language (XSL) template. The pop-up window is loaded with HTML content based on the format of an XSL template. HTML formatting stored as attributes in the layer is used when the values from the attribute are displayed in the pop-up window. This advanced option allows you to create customized HTML content, such as a pop-up window containing images, hyperlinks, and videos. For XSL template examples, refer to the HTMLPopup folder in the <install drive>:\Program Files\ArcGIS\Desktop10.2\Styles directory.
Publishing HTML pop-up windows to ArcGIS Explorer
You can use layer packages as a way to publish HTML pop-up windows for layers to ArcGIS Explorer.