Image maps
Image maps are used for images where you can click on different parts
to go to different pages. Nowadays, this is usually handled in the
browser, by client-side image maps. But it is also possible to do this
in the server. This is done through .map files, where you
define which page the user should be brought to when clicking
somewhere on the image.
The HTML code needed to use an image map is:
<a href=file.map>
<img src=image.gif ismap>
</a> For server-side image maps to work the ISMAP
image-maps module must be enabled. The map file is a text
file where one clickable area is defined per line. The file will be
scanned one line at a time till a directive that includes the point
the user clicked is found. The possible directives are:
- (X1,Y1)-(X2,Y2) URL
-
(X1, Y1) are the coordinates
of the upper left corner of a rectangular area whose lower right
corner has the coordinates (X2, Y2). Any point inside the
rectangle will take the user to the URL.
- (X,Y),R URL
-
Any point inside the circle centered at
(X,Y) and with the radius R will take the user to the
URL.
- (X,Y) URL
-
This specifies a single point and ties a
URL to it. If more than one point is specified in the file, the one
closest to the position on which the user clicks will be used.
- ppm: path
-
Use the PPM file referred to by path. Each
color in that file may give a different URL.
- pgm: path
-
As PPM, but the file is a grey scale file.
- color:(r,g,b):URL
-
In all PPM files referenced, this
color will point to the URL. r,g and b are decimal integers
between 0 and 255 and the color defined is the combination of the red
(r), green (g) and blue (b) intensities. If the file searched is a
grey scale PGM file, the grey scale will be (r+g+b)/3.
- color:(r,g,b)-(r,g,b):URL
-
All colors in the range
will point to URL. If the file searched is a PGM (grey scale)
picture, the grey scale will be (r+g+b)/3.
- color:greyscale-greyscale:URL
-
All colors with an
intensity falling within the range will point to URL.
- default:URL
-
The url URL will be returned if
nothing else matched. Don't forget to set it.
- void:URL
-
The url URL will be returned if the
client doesn't support image maps or if the map file is accessed
without coordinates.
|