Welcome Guest, you are in: Login

FDOT Wiki

RSS RSS

GisFramework



Search the wiki
»
The Hyperlinker component is an abstract base class that provides the low-level functionality necessary for creating a component that hyperlinks users to external websites based on the attributes of a user-specified feature.


Location

Namespace: FDOT.GIS.Client.Components.FloodInventory

XAP File: FDOT.GIS.Client.Components.FloodInventory.xap

Source code: svn://dotsd7gis2/FDOT.GIS.Client.Components.FloodInventory/

Inheriting from Hyperlinker

The Hyperlinker tool contains all of the functionality for querying layer after layer, extracting a single value from the first feature returned, building a URL from this single value, and then invoking the ExternalLink resource to open the web page.

To implement a subclass of the Hyperlinker tool, you must implement the string IconResourceUri get property (inherited from ComponentBase) and the GetOtherParams method:

protected abstract IEnumerable<string> GetOtherParams(QueryResult results);

This method is invoked by Hyperlinker when a feature is found and allows base classes to programmatically add to the parameter list sent to string.Format when the target URL is being constructed. Even if your component does not require any additional parameters to be sent, it is highly recommended (in fact, enforced via the abstract keyword) to subclass Hyperlinker rather than use it directly, as weird behavior can occur when two components have the same type.

Tolerance Options

The Hyperlinker lets users choose which feature to hyperlink from by clicking a point on the map and searching each layer it is configured to search for geometry that intersects with that point. When searching a point layer, it is exceptionally unlikely that the specified point and desired point will intersect. To fix this problem, the Hyperlink tool automatically buffers every point query and uses the generated bufer to query the layers.

The current map width, the Hyperlinker tool's intolerance field, and the Hyperlinker tool's tolerance field all influence the radius of the buffer in the following way:

var bufferRadius = mapWidth.Value / intolerance + tolerance; 

So, tolerance has a bigger effect when the map is very zoomed in, whereas intolerance has a bigger effect when the map is zoomed out. By default, intolerance is set to 50 and tolerance is set to 5. If these settings are not satisfactory, they can be changed by the constructor of the component inheriting from Hyperlinker.

Configuration Options

NameIsRequiredDescription
FormatStringtrueThe format string for the URL to be constructed. Parameter 0 will always refer to the configured attribute value of the feature selected by the user.
MapServiceNametrueA semicolon-separated list of map services to query.
LayerNametrueA semicolon-separated list of layers to query.
ColumnNametrueA semicolon-separated list of attributes to query.

Sample Configuration

Because Hyperlinker is an abstract class, it cannot be used as a component. See FloodInventoryLinker for an example configuration of a subclass

Downloads

FDOT.GIS.Client.Components.FloodInventory.xap Download

See Also

Any Questions or Comments? Email
Some of the icons created by FamFamFam.