Image mapping with the phone.net imagemap program

The phone.net imagemap program is based on the NCSA imagemap program, with some modifications to make it easier to administer and use.

To create a URL that can be used by an image map, you need to create two files - the imagemap.conf file and the map file. Using that map files requires nothing more than the correct link in your HTML file.

The config file

The config file is used to locate the map file from the link used by the image map. The config file is called imagemap.conf, and is in either the http configuration directory, or a your home directory.

In this file, any line beginning with a # is a comment, and will be ignored.

Any non-blank line should be of the form

mapname : path
mapname is the name of the map given in the link for the map. path is the path to the map file. The path is either absolute, or relative to the directory that imagemap.conf is in.

The map file

The map file is used to translate a pair of coordinates to a URL to be accessed from this point.

In this file, any line beginning with a # is a comment, and will be ignored.

Other non-blank lines have the form:

method URL coordinates
Method is one of
rect URL upper-left lower-right
The URL is used if the point selected inside the rectangle.
circle URL center edge
The edge is a point on the edge of the circle. The URL is used if the point is inside the circle.
poly URL point ...
A list of vertices for the polygon. This URL is used if the point is inside the polygon.
default URL
This URL is used if the point is not inside any of the other methods.
error URL
This URL is used if a valid point cannot be found in the query - usually meaning the client browser does not properly support ISMAP images.
URL may be either a path on your server, of the form /path/to/file without the http://server.name part, or an absolute URL.

Note that each method is evaluated as it is found in the file. If two methods overlap, the first one in the file will be used.

Using the image map

To use the image map, put the correct URL in an anchor that contains the image as an ISMAP file. For instance, the example below uses:
<A HREF="/cgi-bin/imagemap/admin/maptest">
<IMG SRC="image.gif ismap>
</A>
The first part of the URL - cgi-bin - is where script files live at phone.net. If you are using a different server, you may need to use a different name here. The second part - imagemap - is the name of the imagemap program. These will always be the same on a server.

If you are using imagemap.conf in your home directory, as this one is, the next part of the URL is your user name on that server, so that imagemap can find the config file. If you are using imagemap.conf in the HTTPD config directory, omit this part.

The rest of the URL is the name of the map in imagemap.conf.

An example

The URL in the example will search imagemap.conf in admin's home directory on phone.net, which contains:
maptest: html/maptest/map
And html/maptest/map contains:
default /maptest/how.html
error /maptest/error.html

rect /maptest/blue.html 150,10 290,150
rect /maptest/black.html 150,150, 290,290
rect /maptest/orange.html 10,150 150,290
rect /maptest/grey.html 10,10 150,150
This example is relatively simple, but has all the parts.
Back to the server lease page.

Please send us any comments you may have. If your client does not support forms, send mail to admin@contessa.phone.net