Using Hyperlinks

Hyperlinks allow you to access documents or Web pages related to features. These hyperlinks can be accessed for each feature using the Hyperlink tool Hyperlink on the Tools toolbar. This topic describes how to set and use hyperlink properties for a map layer.

Hyperlinks have to be defined before you use the Hyperlink tool, and they can be one of three types:

You can define a hyperlink for the features in a layer either by defining a dynamic hyperlink or using field-based hyperlinks.

NoteNote:

An alternative, and often more flexible, tool is available that uses HTML pop-ups. Clicking features reports additional information and attributes using HTML and Web methods.

Defining hyperlink properties

  1. Right-click the layer for which you want to set hyperlink properties and choose Properties.
  2. Select the Display tab on the Layer Properties dialog box.
  3. Check Support Hyperlinks using field.
    Setting Hyperlink properties
  4. Select the field name you wish to use for your hyperlink and the link type — Document, URL, or Script. If you choose to use a script, use the Edit button to write your script using JScript or VBScript. Then, click OK.
    Dialog box to compose your hyperlink script
  5. Click OK or Apply on the Layer Properties dialog box.

Using hyperlinks

  1. On the Tools toolbar, click the Hyperlink tool Hyperlink. This transforms your mouse pointer into a lightning bolt.
    NoteNote:

    Any visible features in the map that have hyperlinks defined are drawn in blue, the default color, or outlined in blue in the case of polygons. When you are over a feature for which a hyperlink exists, the mouse pointer turns into a black lightning bolt with a flash, and you see a pop-up tip with the name of the target.

  2. Click a desired feature or location in your data frame to access hyperlink information.
    Clicking a feature
  3. This will bring up the hyperlink information such as an HTML Web page.
  4. If you have hyperlinks turned on for multiple layers, clicking a location in your data frame provides a Hyperlinks dialog box to choose a feature from one of the layers. The layer name is listed in parentheses.
    Dialog box for multiple hyperlinked layers

Changing the hyperlink color for features

You can use ArcMap settings to set the color for displaying hyperlink features using the following steps:

  1. Click Customize > ArcMap Options.
  2. Click the General tab.
  3. Check When the Hyperlink tool is selected, highlight features containing clickable content.
  4. Click the color drop-down menu to specify a different color for the highlights.
    Setting the hyperlink display color

Defining dynamic hyperlinks through Identify results

You can dynamically add a hyperlink to a feature using the Identify tool Identify. With dynamic hyperlinks, you do not use an attribute field to supply the hyperlink targets. The hyperlink target you specify is associated with the identified feature. This association is stored with your layer.

  1. Click the Identify tool Identify on the Tools toolbar.
  2. Click the feature for which you want to define a hyperlink.
  3. Right-click the feature in the Identify window and click Add Hyperlink.
  4. Specify the desired hyperlink target.
NoteNote:

The Hyperlink Base setting has no effect on dynamic hyperlinks.

CautionCaution:

After deleting features from a shapefile, you may find that dynamic hyperlinks are attached to different features. This occurs because ArcMap uses the feature ID (FID) field to associate dynamic hyperlinks with features, but the FIDs of shapefiles must be recalculated when features are deleted. To ensure hyperlinks are always associated with the proper features, only use dynamic hyperlinks with geodatabase features classes (geodatabase features always have unique ID values). Field-based hyperlinks can be used with shapefiles without this limitation.

Managing hyperlink paths

As part of a map's properties, you can specify a hyperlink base, which is the base path or URL used for field-based hyperlinks to documents or URLs. For example, if the hyperlink base is set to D:\Data, then the values in the field or fields used as hyperlinks to documents don't have to contain D:\Data. They can just contain the name of the file.

The Hyperlink Base property is specified on the Map Document Properties dialog box. Click File > Map Document Properties to open. If the location of the targets changes, you can simply update this one setting instead of having to edit each value of the field providing the hyperlink targets.

Making hyperlinks with relative paths

Sometimes, you may want to give a map that contains hyperlinks to someone who does not have access to your network resources. Just as you can save the map with relative paths to the data, you can also specify hyperlinks that refer to a location relative to the map.

To specify a path to a document in the same folder, type the document's name. For the example below, you would type directions.bmp (that is, do not include a \ or drive letter prefix).

The map document and hyperlink files in the same folder

To specify a path through a folder immediately below the map's location in the file system, start the path with the folder name (again, no \ or drive letter prefix). For the example below, you would type Graphics\directions.bmp.

Hyperlink documents within a subfolder below the map document's location

Using parameters to control how a program opens a hyperlinked document

Hyperlinks to documents can contain parameters that define how the program opens the document. For example, parameters can tell Adobe Reader to open a PDF to a specific page, allowing map features to hyperlink to different pages in the same document. Since each software package (such as Microsoft Word, Microsoft Excel, Adobe Reader, and so on) has unique commands, consult the documentation for the software package used to open the document for the parameters and syntax available to it.

Many times, these parameters will be provided for use in a command line. For example, to open a .PDF document to page 5, the command line might look like the following:

where

ArcGIS does not read these parameters like a command line. Instead, it uses a special delimiter, a ? (question mark), to separate the file path from the parameter. The hyperlink to the same document and page in ArcGIS would look like this:

The ? serves as the delimiter between the path and the parameter.

Related Topics


8/2/2012