Enhance ArcGIS 10 Maps with Custom MapTips

Have you ever explored a map document and not found the information you were looking for? The table of contents tells what a feature symbol represents, but that alone may not provide enough information when map users are interacting with a map for a specific purpose.

To access the data associated with a feature, map users can open the layer attribute table or use the Identify tool. When a layer has a lot of attributes that are cryptically named, though, having map users wade through them is not ideal. Yes, you can turn off some table fields, set field aliases, and even create HTML pop-ups, but ArcGIS gives you an easier way to make a map more user-friendly: “smart” MapTips.

A MapTip is the text that pops up in ArcMap’s Data View when you hover your mouse pointer over a feature. The text is a value from the layer’s attribute table. By default, a MapTip displays the value exactly as it’s stored in the table. And while MapTips in ArcGIS 10.x actually have the same IQ as MapTips in earlier releases, you can be smarter about how you use them—because you can create expressions to customize MapTips.

  • The ability to create label expressions in ArcMap has been in place for a long time. Creating an expression for a MapTip is the same thing. The example below shows how easy it is.

Click to see larger map

Create a Custom MapTip

Scenario: The map on the right shows child care facilities, hospitals, and emergency shelters in New Orleans on top of the Topographic basemap from ArcGIS Online. Suppose your job is to create emergency response plans to ensure the safety of children at child care centers in harm’s way. You need to know the number and distribution of the population at risk. You’re going to do an in-depth analysis, but first you want to do a quick visual exploration to understand the magnitude of the planning effort.

The Child Care Facilities layer already has a MapTip in place, the facility name. The name is useful information but you’d also like to display the maximum number of children potentially at a facility on any given day. You know that data is stored as an attribute, so it can easily be added to the MapTip by following these steps:

  • Open the Layer Properties dialog box for the Child Care Facilities layer and click the Display tab.
  • In the Field drop-down list, choose the field that you want to display first in the MapTip. In this case, [NAME] is already selected.
  • Check the box next to “Show MapTips using the display expression,” then click the Expression button. Click to see larger dialog

In the Display Expression dialog box, you build the expression to display the MapTip text the way you want. By default, VBScript is the selected parser. You can also use JScript or, if you have ArcGIS 10.2, you can use Python to build MapTip expressions as well.

  • In the Fields list, click the additional field you want to see in the MapTip (in this case, [CAPACITY]), then click Append.

The CAPACITY field is added to the expression box and ArcMap automatically adds a space between the two fields (two double quotes separated by a space will create a space in the text; ampersands are used to connect each piece of the expression).

For easier reading, you want to display the MapTip text on two lines.

  • In the expression box, click after the first ampersand, delete the quotes, then type vbNewLine. Expression for two-line MapTip
  • Click Verify to make sure the expression is valid, then click OK. Click OK twice again to close the open dialog boxes.  Click to see larger map

Now when you hover over a child care facility on the map, you see two pieces of data in the MapTip and they each display on a separate line. This is what you want.

There are a couple of improvements you can make. Map users likely won’t know what the number means. You can make the MapTip more informative by preceding the capacity value with text that provides context. Also, the MapTip text is right up against the rectangle it displays within. It would be a nice touch to add some extra space on the left side of each line.

  • Reopen the Layer Properties dialog box and click Expression in the Display tab.
  • In the expression box, click just before the [CAPACITY] field and type “Capacity: ” & (be sure to type the space after the colon).
  • At the beginning of each line, add a space using double quotes (” “) followed by an ampersand (&).

Final MapTip expression

  • Click to see larger mapClick Verify to make sure your expression is valid, then click OK. Click OK again twice to close the open dialog boxes.

Just like that, all the child care facilities have a readable MapTip that shows both their name and the maximum number of children that may be present.

MapTips are a property of a layer, so they are saved with layer files (.LYR) and layer packages (.LPK). The powerful thing about working with a GIS map is that you can access the data behind the map—the attributes associated with map features are right there, just waiting to be explored. MapTips can help you bring your data front and center.

SuzanneB

About SuzanneB

Suzanne is a Maryland native with a degree in English Literature who enjoys writing about Esri technology and other topics. She works with Esri Training Services in Redlands, California.
This entry was posted in ArcGIS Step by Step and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

6 Comments

  1. ExpertUser says:

    This can also be done in 9.3.1 right, except maybe the hover feature?

  2. SuzanneB says:

    At 9.x you could create expressions for map labels; the ability to create expressions for MapTips is very similar but new at version 10.

  3. palace says:

    Can the MapTip display a raster (jpeg) somehow?

  4. SuzanneB says:

    Yes, if you have a raster attribute field in a geodatabase feature class, you can create a display expression to show the values (rasters) in that field. You could also attach the raster to the feature and show the raster in an HTML popup–this would be preferred if the raster size is large. See this help topic for more information: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001t000003vt000000.htm

  5. pneum50 says:

    I have some questions related to this topic.
    How can you display more than one record in a MapTip? I have up to 144 lines of data and I need to show those in a MapTip.
    Let me explain:
    I have three fields (A, B, C) and I need to display different records for those fields so that the MapTip looks like this:
    A.      833 B. Elm C. St
    A.      288 B. Oak C. Ave
    A.      909 B. 1st C. St  (etc  for up to 144 lines)
    I’m looking for a command in vbScript that would allow me to do this.
    Thanks