This example shows how imagemaps can be done using the Opus One server.

There are two ways of doing image maps. The first one shown below is more efficient, but does not use the same format as the standard Unix servers. The second example is "plug-compatible" with a Unix server.

In either case, all imagemaps need need to have three files. The first is the HTML wrapper (which is the file you're reading now). The other two are pointed to out of the HTML wrapper: one is the imagemap file (which has an extension of .imagemap) and one is the presentation graphic, typically a .GIF file (although you could use JPEG if you didn't care about Mosaic users).

The imagemap file is in CERN format. Any map program should be able to put that format out (the other possibility is NCSA, which is functionally equivalent but has a very different syntax). If you want to find out more about the CERN format from the WWW consortium, click here.

The biggest gotcha we've found is that people sometimes to fully qualify their URLs in an imagemap. You must do this, because the client has insufficient context to fill in a relative URL with perfect results. If you look at the example .IMAGEMAP file, you see that we have left off the scheme and host address, but have otherwise used a fully qualified URL, from the "root," /

Use View Source... to see the .HTML file (this file). If you want to copy the actual HTML and Imagemap, DISK$EBONY:[HTTPD.WWW.DEMO]IMAGEMAP.HTML and DISK$EBONY:[HTTPD.WWW.DEMO]IMAGEMAP.IMAGEMAP.

The image below is mapped using the ISMAP option. The anchor that this image belongs will translate to a script execution that links portions of the image to other anchors in the text. The /$mapimage/ HREF reference in the image anchor invokes a special builtin imagemap handling by the server. The presentation method demo uses the WWWEXEC script.

Script Method:

Presentation:

The Earring

The region of the earing is mapped by a circle defintion.

The Face

The region of the face is mapped by a polygon with 42 vertices.

The Hair

The hair region is another polygon.

The Backgound

Anything not in another region is background.


Here is the documentation on the script format. There are four keywords:
default URL
URL which is used if click is in none of the given shapes. This should always be set!

circle (x,y) r URL
Circle with center point (x,y) and radius r.

rectangle (x1,y1) (x2,y2) URL
Rectangle with (any) two opposite corners having coordinates (x1,y1) and (x2,y2).

polygon (x1,y1) (x2,y2) ... (xn,yn) URL
Polygon having adjacent vertices (xi,yi). If the path given is not closed (first and last coordinate pairs aren't the same) the first and last coordinate pairs will be connected by htimage. So first point is added also as the last one if necessary.

These can be abbreviated as def, circ, rect, poly.

Shapes are checked in the order they appear in config file, and the URL corresponding to the first match is returned. If none match, the default URL is returned.

URLs are


Opus One Technical Support
Updated 10-July-1996