next up previous contents
Next: Map Editors Up: Imagemap Configuration Previous: NCSA HTTPD's Imagemap

CERN HTTPD's Htimage Command

The CERN htimage program is quite similar to the NCSA imagemap program, with the exception that htimage has no master configuration file. If we called { htimage from this URL:

  http://www.host.name/cgi-bin/htimage/usr/www/uk_map?404,451
then htimage gif would get executed with the QUERY_STRING environment variable set to `` 404,451'' and the PATH_INFO environment variable set to `` /usr/www/uk_map''.

htimage then uses the configuration file `` /usr/www/uk_map'' to translate the coordinates `` 404,451''. The syntax of the configuration file is similar to NCSA's imagemap. An example file might be:

default http://www.cs.ucl.ac.uk/misc/uk/intro.html#map
#London
circle (416,451) 20 http://www.cs.ucl.ac.uk/misc/uk/london.html
#Canterbury
circle (442,463) 30 http://www.cs.ucl.ac.uk/misc/uk/canterbury.html
#Cambridge
circle (413,405) 35 http://www.cs.ucl.ac.uk/misc/uk/cambridge.html
#Bradford
circle (337,312) 18 http://www.cs.ucl.ac.uk/misc/uk/bradford.html
rectangle (335,317) (372,325) http://www.cs.ucl.ac.uk/misc/uk/bradford.html
#Birmingham
rectangle (335,387) (394,397) http://www.cs.ucl.ac.uk/misc/uk/birmingham.html

There are four allowed keywords in the configuration file:

default URL

This gives the URL to redirect to if the user clicked in none of the specified shapes.

circle ( x , y ) r URL

This specifies a circle with centre ( x,y) and radius r.

rectangle ( x1 , y1 ) ( x2 , y2 ) URL

This specifies a rectangle with top left corner (x1,y1) and bottom right corner (x2,y2)

polygon ( x1 , y1 ) ( x2 , y2 ) ...( xn , yn ) URL

This specifies a polygon with vertices (x1,y1) .. (xn,yn). If the first and last points are not the same, htimage will automatically close the polygon.

The abbreviations def, circ, rect and poly are also allowed. The order of the shape definitions in the file is important, as if two shapes overlap, the first one that matches the position clicked on is the one that will be chosen. If the clicked position doesn't fall within any of the shapes, the default URL will be returned.



next up previous contents
Next: Map Editors Up: Imagemap Configuration Previous: NCSA HTTPD's Imagemap



Jon Crowcroft
Wed May 10 11:46:29 BST 1995