If you wish to use client-side imagemaps (recommended), you would
put these script lines within a "map" tag format:
<MAP NAME="demo">
<AREA SHAPE="RECT" COORDS=
"24,18,143,41" HREF="doc1.html">
<AREA SHAPE="RECT" COORDS=
"168,18,287,41" HREF="doc2.html">
</MAP>
The image tag itself would look something like:
<IMG SRC="image.gif" USEMAP="#demo">
There are several HTML editors that will create these script lines
for you; for example, Claris Homepage and Web Weaver. You might also wish to
look at Spyglass'
Client-side Imagemap Tutorial.
If you wish to use server-side imagemaps, use the following
syntax in a separate text file:
Default URL (usually the current document) rect URL left(x),top(y)
right(x),bottom(y)
[or]
circle URL center-x,center-y
edge-x,edge-y
[or]
poly URL x1,y1 x2,y2 ... xN,yN x1,y1
(type a rect, circle, or poly line for each hotspot in the map)
- Save your script as "<something>.map". Put the HTML file
referring to the image map, the GIF file and the map script file on the
server. The GIF file and the map script usually go into a
"/cgi-bin/imagemap" directory.
- If you use a Macintosh, there is also a program that will
automatically generate a script of coordinates for you: MacMapMaker,
available at http://www.ncsa.uiuc.edu/edu/MMM/.
If you do use MacMapMaker, please note that you will need to save the
graphic as a PICT to generate the coordinate script AND as a GIF to use on
your web server. After starting up MacMapMaker, create a new "map" (click
the "new map" button), load in the "PICT" form of your graphic (click the
"load" button), and create all the hotspots you want (using the hotspots
tools). When you're done be sure that NCSA HTTPd is selected as the output
format (menu item).
- There are also map-generating
programs available for PC Windows and Unix.
- Now you're ready to write the HTML tag line in your base HTML file
that will reference the image map.
- <a href="/cgi-bin/imagemap/file.map"><img
src="directory/of/your/image/file/image.GIF" ismap></a>
- Note that your webmaster will probably have the server set up so
that all imagemaps need to go into a single directory, such as
"/cgi-bin/imagemap/"; you probably will not be able to simply put the
image map files in your own directory; you will need to submit these
files to your webmaster. If you are a webmaster, you will want to create
a "cgi-bin/ismaps" directory in your HTTPd directory and put all ".map"
files in that directory.
- You need to test your "map" by putting your files on a server. You
won't be able to test your "map" by reading the HTML file in "locally"
since there is no server application to carry out the instructions in the
"script" file.