|
To link a map objects with www resources you have to define URL templates. URL template can contain tags that will be dynamically substituted at runtime with values from attribute data or other program variables.
For example "NAME" is field name from Cities layer and your link is:
http://www.xyz.com/[NAME].html
If user selects Paris on map, applet request the browser show the document
http://www.xyz.com/Paris.html
The field value can be formatted. You may define the result length and char case. Length specifier indicates that the resulting string must be specified length; if the field's value has less chars, the resulting string is left-padded with zeros. Char case specifier may be $U (the resulting string will be in upper case) or $L (lower case).
For example your link is:
http://www.xyz.com/photos/[PHOTO_ID,5,$L].jpeg
If value of field PHOTO_ID is "1A" the the resulted URL will be
http://www.xyz.com/photos/001a.jpeg
The following table summarizes other possible tags:
| $LAYERNAME | name of current (active) layer (defined by "label" attribute). |
| $LAYERID | id of current layer (defined by "name" attribute). |
| $DATASETID | id of current layer (dataset id) in Clearinghouse database |
| $PASSTHROUGH | this tag is substituted with value of applet's parameter "external". |
| $SEARCH | the value of search criterion for "searchlink", or list of records ids for "infolink" |
| Extents. The tags that start with "BBOX" gives a single comma-delimited string in a particular order containing values for xmin, xmax, ymin and ymax. Four others are substituted with the separate coordinates. |
| $BBOXALL | current map extent |
| $BBXMIN, $BBXMAX, $BBYMIN, $BBYMAX |
| $BBOXDR | marked extent |
| $DRXMIN, $DRXMAX, $DRYMIN, $DRYMAX |
| $BBOXSEL | extent of selected records |
| $SELXMIN, $SELXMAX, $SELYMIN, $SELYMAX |
The links may defined in the metadata or in project file.
In metadata:
...
In project file:
http://www.google.com/search?q=[NAME]
http://www.xyz.com/q=[NAME]
If link for a layer is defined in project file it is utilized instead of link from metadata. The project level link is used by default if layer hasn't a link.
There are four types of web links.
| Name of element in project file |
Metadata element # |
Description |
| mainlink |
63 |
It is utilized when program has to create a link for a particular object - when user selects one object on map or highlights a row in the grid on the attribute window |
| infolink |
302 |
Invoked when user selects several objects. If this link is defined, the program uses it instead of opening an attribute window |
| searchlink |
301 |
This link overdefines the internal search routine. |
| tipslink |
310 |
It's used instead of standard tips. It's invoked when user moves the cursor over objects on map. Because this link is invoked very frequently, it is recommended to link some client side resources. For example javascript invocation in the neighbour frame. |
before v0.84 mainlink was renamed from linkmask
By default applet request the browser show the linked Web page in HTML frame (or window) with name "infoWindow". Before it, applet tries to load in this window the page top.html. This page contains small JavaScript code that gives focus (moves on top) to the this browser window. You may define your own target browser frame and pre-load page via applet's parameters:
To prevent preliminary load, set the value "no" for parameter "prepage".
This example demonstrates how the links work. Compare behaviour of layers with and without links.
See project file
|