WASD Web Services - Environment Overview

5 - Clickable Image Support

5.1 - Image Configuration File
5.2 - Examples
[next] [previous] [contents] [full-page]

Clickable image support is provided as an integral part of HTTPd functionality (i.e. it is does not require script execution), and so can be quite efficient. It will process both NCSA and CERN configuration formats (in the same file if necessary, although for clarity that should be avoided).

Digression ... How It Works

When the image specified in the anchor is clicked upon the browser sends a mapping configuration file URL, specified in the HTML anchor, along with the pixel coordinate of the click, as a query string, to the HTTPd server. The server interprets region specifications in the configuration file to determine which region corresponds to the coordinates in the query string. A matching specification's URL, or a default if none match, is then accessed by the server (if local), or sent back to, and then transparently reaccessed by the browser (redirected, if a different protocol or host).

Steps For Using a Clickable Image

  1. create an image configuration file (see 5.1 - Image Configuration File), mapping pixel coordinates of regions within the image to URLs
  2. specify an HTML anchor using an inline "<IMG...>" tag, the "HREF=" specifies the path to the image configuration file
  3. specify "ISMAP" in the "<IMG...>" tag

    For example:

    <A TARGET="_blank" HREF="ismap_demo.ismap">
    <IMG SRC="ismap_demo.gif" ISMAP></A>
    

5.1 - Image Configuration File

Image configuration is done using a plain-text file containing region keywords specifying image pixel coordinates and associated URLs. Clicking within these coordinates results in the corresponding URL being returned. Four keywords defining geometrically shaped series of coordinates are provided, along with a default keyword. These can be supplied in either of two formats. The NCSA format may be more commonly used.

  1. NCSA
  2. CERN

For online examples of rule usage within configuration files see 5.2 - Examples below. Note that:

hint ...

To establish the region keywords and coordinates required for the configuration file it may be necessary to use a program such as "XV" to display the image, then by using the mouse locate the required parts of the image, reading off and noting the coordinate pairs, and finally using these to compose the configuration file.


5.2 - Examples

See example in the WASD_ROOT:[EXERCISE] directory.


[next] [previous] [contents] [full-page]