Layer hyperlinks are links to web pages that are relevant to the layer. They give the end user easy access to information related to the current layer. For example, if a layer has a metadata URL, you could create a layer hyperlink that points to it.
Layer hyperlinks configured for image services are not supported in the HTML5 Viewer.
Layer hyperlinks appear in the Layer Actions menu. To open the Layer Actions menu, the user clicks the Layer Actions icon next to the layer in the Layer List.
Layer hyperlinks can be static URIs, or they can be generated at runtime in the viewer. Generating the URI at run time makes it possible to build URIs that contain values specific to the selected layer. This is done by including layer tokens into the configured URI. Layer tokens are replaced at runtime with the value of the property for the selected layer. Layer tokens can also be used in the hyperlink's text and tool tip.
Layer hyperlinks can be configured for individual layers (see Example 1), or they can be configured at the level of the parent map service (see Example 2). Adding a layer hyperlink to the map service makes the link available on each layer in the service.
Example 1: Link to an Individual Layer's Metadata
Suppose your site's Parcels layer has metadata that you want to make available to end users. You configure a layer hyperlink like the one shown below.
Configuration of a layer hyperlink to display layer metadata
The user clicks the Parcels layer in the Layer List to open the layer's context menu. The layer hyperlink is in the context menu with other layer-specific information and actions.
Layer hyperlink in the Parcels layer's context menu, and its metadata in a new window
Example 2: Link to the Metadata for Every Layer in a Map Service
Suppose you want every layer in a map service to have a link to its metadata. Configuring a layer hyperlink for every layer is tedious and time consuming. Instead, add the layer hyperlink to the map service. This makes the hyperlink available on every layer in the map service and saves a lot of configuration.
The approach in this example requires consistency:
The name of each metadata file should follow a pattern.
For this example, the name of each file is simply the name of the corresponding layer. If the Tax Parcels layer metadata file is TaxParcels.html
, then the Land Use layer metadata file should be LandUse.html
.
Each file should be placed in a common folder.
In this case, the {VirtualDirectoryUri}/Metadata/
folder.
If you host the metadata folder in your site's virtual directory, you can use the {VirtualDirectoryUri} client token in the layer hyperlink's URI field. This streamlines configuration and maintains site portability.
See the configuration for the layer hyperlink is shown below. Each layer generates unique text, URIs, and other layer-specific values thanks to the configured client token {LayerName}.
Configuration for a layer hyperlink that applies to all layers
As a result of this configuration, each layer links to an HTML file with the metadata for that layer. Here is a description of the result:
In the user interface, the text for the Tax Parcels layer's hyperlink is generated as Metadata for Tax Parcels.
The URI it links to ends with Parcels.html
.
The {LayerName} token has been replaced with "Tax Parcels" in the text throughout.
Similarly, the text for the Land Use layer's hyperlink is generated as Metadata for Land Use.
The URI it links to ends with LandUse.html
.
The {LayerName} token has been replaced with "Land Use" in the text throughout.
See also...
Layer hyperlinks have the following settings:
Hyperlink Text: (optional) The text for the link. You can use layer tokens in the Hyperlink Text box. Click Edit to select from a list of available tokens.
If you leave the Hyperlink Text box blank, the URI is used.
URI: The URI to link to. You can use layer tokens in the URI box. Click Edit to select from a list of available tokens.
Encode Replacement Values: Specify whether to URL encode the values used to replace layer tokens. URL encoding replaces characters that are not valid in URLs with valid characters.
The default setting, Automatic, URL encodes tokens when they are combined with text. If the URI box contains only a token (no text), the viewer does not URL encode the value—it assumes the token defines a complete URI that is already URL encoded.
Tool Tip: (optional) The text to display when the mouse hovers over the hyperlink. You can use layer tokens in the Tool Tip box. Click Edit to select from a list of available tokens.
Icon URI: (optional) The URI of the icon to display beside the hyperlink. If you leave the Icon URI box blank, the default icon ( ) appears beside the layer hyperlink.
Target: The name of the browser window to open when the user clicks the hyperlink. To open the target in a new window, enter _blank
.
To add a layer hyperlink:
In
To add the hyperlink to all the layers in a map service, edit the map service.
To add the hyperlink to a single layer, edit the layer.
Click the Layer Hyperlinks tab.
Click Add Layer Hyperlink.
Configure the settings.
Click OK.
To reorder list items, click and drag the Sort handle .