Conceptually this is done by creating on the server a map between certain regions and the corresponding action. These regions can be specified as boxes, circles, or enscribed polygons.
(For additional information see the NCSA ISMAP documentation)
A nice graphical tool (for UNIX and Windows) for creating imagemap
databases can be found at:
http://sunsite.unc.edu/boutell/mapedit/mapedit.html .
bozo.gif is declared active:
<A HREF="http://www.utirc.ca/cgi-bin/imagemap/map_bozo"> <IMG SRC=bozo.gif ISMAP> </A>The ISMAP attribute declares the image to be active - when you click the mouse over the image the browser sends to the server the pixel coordinates of the mouse, with respect to the image origin.
imagemap. This program is
designed to process the ISMAP data returned by the browser, and
activates the correct URL by comparing the mouse coordinates with
information in an imagemap database.
The imagemap script is not referenced directly,
as it must be also told which image database to use. This is done by
accessing imagemap/name where name is the
image name This sybolic name is used to indicate the
appropriate database file. This file is obtained from the
imagemap.conf configuration file.
The database is divided into two parts. The first level is
the names database file, usually called imagemap.conf.
[The full path of this file is fixed in the source code
imagemap.c and should be modified as appropriate
for your server configuration.]
The imagemap.conf file contains a list of mappings
between image names and corresponding image maps.
These mappings are entered:
name: path_of_mapwhere
path_of_map is the full path to the map configuration
file. For example the entry for my example would be:
map_bozo: /vast/u1/etc/httpd/conf/bozo.mapSince
map_bozo was the image name specified in
my hypertext URL.
imagemap will access the method URL x1,y1 x2,y2 ... xn,ynThe meaning and required number of coordinates (x1,y1) depends on the method. The different methods are:
circle
centre edgepoint
rect
upper_left lower_right
poly
URL is either a relative or absolute URL. Recall that a
relative URL is a URL to the server being currently accessed, but without
the http://hostname part, and that in the absence of a leading
slash the document is searched for relative to the directory containing the
current document.
xv does this quite easily,
as do a number of commercial packages.
Recall that the IMG element can only display GIF and X-bitmap images inlined. Therefore you can only use these format images.
The NCSA ISMAP documentation contains further descriptions of the ISMAP facility, along with examples of an active image and of a map configuration file.
Thomas Boutell has written a nice Windows and UNIX program for graphically
editing an imagemap database file directly from the image. Information about
mapedit can be found at:
http://sunsite.unc.edu/boutell/mapedit/mapedit.html.