The Improved imagemap Script

Eternal gratitude to Kevin Hughes, kevinh@pulua.hcc.hawaii.edu, for his code to find intersections of points with circles and polygons.


The Central Configuration File

The imagemap script expects to find its configuration file as:

/usr/local/etc/httpd/conf/imagemap.conf.

If you would like to change the location of this file, edit cgi-bin/src/imagemap.c, change the setting of CONF_FILE, and recompile with make imagemap.

In this file, lines beginning with a # are comments. Every other non-blank line consists of:

name : path

name is the name of the particular mapping. You use it when you reference the image.

path is the full path to the map configuration file for this mapping.


The Map Configuration File

This file maps regions to URLs for the given image.

Lines beginning with # are comments. Every other non-blank line consists of the following:

method url coord1 coord2 ... coordn

coord are each coordinates, format x,y. The number depends on method.

method is one of the following:

url is one of the following:

Referencing Your New Map

To reference your new map, you construct URLs pointing to it.

For example, if you have a ScriptAlias /cgi-bin/ /usr/local/etc/httpd/cgi-bin, named your map fish, and used the image fish33.gif for the map, the following line of HTML will reference it:

<A HREF="/cgi-bin/imagemap/fish"><IMG SRC="fish33.gif" ISMAP></A>


A Complete Example

The fish demo in another section of this manual used the following configuration files:

Central Configuration File

fish : /usr/local/etc/httpd/conf/fish.map

Map Configuration File

The map configuration file used for this picture was rather lengthy. I used xv to get the coordinates.


Return to administration overview

httpd@ncsa.uiuc.edu