Sample Imagemap application

Here is a very simple sample of the CGI program imagemap for processing images from NCSA. Click in the box with the picture above and the NCSA imagemap program will produce a response. If you click in the upper left corner you will get the GNU public license. If you click in the upper right hand corner you get a message to that effect. Otherwise you get the GN announcement.

I had no trouble following the instructions from NCSA. The only deviations from their instructions were to rename the imagemap binary to imagemap.cgi after compiling since gn requires a .cgi extension for any CGI script or program. Also I learned that all configuration and map files should end with a newline (it's easy to leave that out if you use emacs).

Here are the contents of the relevant files:

imagemap.conf:

escher:/GN_ROOT/docs/gn/examples/escher.map escher.map default /0/announce-2.0 # Upper left corner (use xv to get coordinates) rect /0/docs/Gnu_License 0,0 60,60 menu file entries: Name=Sample Imagemap application Path=0/docs/gn/examples/ismap2.html Name=Compile version of NCSA imagemap program Path=CGI/docs/gn/examples/imagemap.cgi Attribute=invisible

A simple example with a script

This example does not use the imagemap program, but a simple script instead. It shows you how to get the coordinates of the point on which the user clicked. It is then up to your script to do something with them. (The point of the imagemap program illustrated above is to handle this for you and transtlate regions clicked in to URLs).

Click in the box with the picture above and the sample script will be run with the coordinates of the point on which you clicked as parameter. The script does nothing but print the coordinates.

John Franks
.