imagemaps

This sections describes how to setup and use imagemaps (inline images with several hotspots). The NCSA httpd server for MS-windoze is used as an example, but the concepts should be common to all httpd servers which support CGI.

There are three files you will need to edit:

imagemap.cnf
This file should exist in the conf sub-directory of your httpd installation directory. This is a text file which contains one line for each imagemap to be processed. If this file does not exist, you can create a new one.

The format of this file is:

  label : mapfile
The mapfile includes the full path to the mapfile.
mapfile
This is the file referenced from the imagemap.cnf file. It is a text file which describes the shapes of the hotspots.
  default url
  circle  url  origin_x,origin_y  perimeter_x,perimeter_y
  rect    url  vertex1_x,vertex1_y verterx2_x,vertex2_y
  poly    url  x1,y1 x2,y2 x3,y3 ... xn,yn
url is the name of the url to fetch when the hotspot is pressed.

your html document.
Once you have done the first two stages, you can refer to the imagemap from you document. An example is:
  <A HREF=/cgi-win/imagemap program/label>
  <IMG SRC=image ISMAP></IMG>
  </A>
Note that some versions of Mosaic dont like the </IMG> tag. These can be omitted.

Unless you specify a default URL for your imagemap you will get a server error when you click on an area of the image which is not covered by a hotspot.

Notes

the imagemap program will normally be called imagemap under UNIX. It will have a different name for other operating systems (eg imagemap.exe for Windoze).

The mapfile is independant of the actual image that is used. If you change the image, remember to edit the mapfile.

The mapfile is edited by hand, getting the hotspots exactly right will take a bit of trial and error. Picture viewers will often tell you the position of your cursor within an image, this can help immensely when trying to locate the hot-spots.

it may be necessary to make all references to documents absolute when using imagemaps (ie the <A HREF=...>>; tag.