imagemaps

This sections describe how to setup and use imagemaps (inline images with hot-spots). 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.

NOTE due to filename restrictions of msdos, all the .conf files are named as .cnf under MSwindows.

There are three files you will need to edit:

imagemap.conf
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 is the filename (including its full path) of the file containing the descriptions of the hot-spots.
mapfile
This is the file referenced from the imagemap.conf file. It is a text file which describes the shapes of the hot-spots.
  default url
  circle  url  origin_x,origin_y  perimeter_x,perimeter_y
  rect    url  vertex1_x,vertex1_y vertex2_x,vertex2_y
  poly    url  x1,y1 x2,y2 x3,y3 ... xn,yn
url is the name of the url to fetch when the mouse is clicked over that hot-spot.

The consequences of having over-lapping hot-spots is not defined.

your html document.
Once you have done the first two stages, you can refer to the imagemap from your document. An example is:
  <A HREF=/cgi-bin/imagemap/label>
  <IMG SRC=image ISMAP></IMG>
  </A>
The label is used to select the mapfile to use from the imagemap.conf file.

The server will normally be setup to have an alias cgi-bin. This is where the imagemap program and its utilities normally lie. It is possible to use another imagemap program by simply using its absolute path, or another alias.

NOTE the </IMG> tag is not supported by Mosaic and 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 hot-spot.

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 independent 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 hot-spots 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 will be necessary to make all references to documents absolute when using imagemaps (ie the <A HREF=...>>; tag. This mis-feature may be resolved in later versions of httpd.