NCSA httpd imagemap Script
There is a new imagemap.c file that has advantages over the old one.
Compile the imagemap script
If you downloaded the new imagemap.c, you need to compile the imagemap script.Do this by first cd'ing into your ServerRoot, and then cd into the cgi-src subdirectory. Put the new imagemap.c source in place of the old one and then, type make imagemap
and
you should be all set.
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:
-
default
For the default Url. Coordinates: none
-
circle
For a circle. Coordinates: center
edgepoint
-
poly
For a polygon of at most 100 vertices. Each coordinate is a
vertex.
-
rect
For a rectangle. Coordinates: upper-left lower-right
-
point
For closest to a point. Coordinate: thePoint
url
is one of the following:
- a virtual pathname to a file on your server (i.e. a URL to your server without the
http://hostname part)
- a URL
Notes:
- each method is evaluated in the order it is placed in the
configuration file. If you have overlapping areas, such as a circle
inside of a rectangle, you should place whichever one you want
evaluated first before the other in the map file. In this case, we
would put the circle before the rectangle.
- Also note that it does not make sense to use the default method with the
point method because if even one point method is specified, anywhere you click
will be considered close to the point and the URL specified by point will be
serviced.
Referencing Your New Map
To reference your new map, you construct
URLs pointing to it.
For example, if you have created a example.map file in the directory called path in
your public_html home directory, and used the image sample.gif for the map,
the following line of HTML
will reference it:
<A HREF="http://foo.edu/cgi-bin/imagemap/~username/path/example.map">
<IMG SRC="sample.gif" ISMAP>
</A>
A Complete Example
Take a look at this Demo which also makes use of some of the features.
The steps used to setup the demo imagemap are listed.
Make a imagemap
I made a tajmahal directory in my public_html
directory and wrote a tajmahal.map.
The utility xv
was used to get the coordinates in this Map Configuration File.
Referencing the map
I have the picture in a file called tajmahal.gif. To reference my
map, I have this HTML line
<A HREF="http://hoohoo.ncsa.uiuc.edu/cgi-bin/imagemap/~agoyal/tajmahal/tajmahal.map">
<IMG SRC="tajmahal.gif" ISMAP>
</A>
Return to
administration overview
httpd@ncsa.uiuc.edu