You can define multiple links in an image (image file). If you click on the specified point, the coordinate position and the image file name are sent from the Web browser to the Web server. The Web server searches for a URL that corresponds to the image map file and coordinate position, and responds to the Web browser. This is called image map.
To use the image map, you need to define mapping file extension in the imap-file handler.
AddHandler imap-file .map |
You can specify the image map data in following three formats:
shape name specification value coordinate shape name specification value "descriptive text" coordinate shape name specification value coordinate "descriptive text" |
"descriptive text" denotes the explanation sentence when map file menu is displayed and coordinate denotes the coordinates of images.
Table 4-15 describes the shape name and table 4-16 describes the specification value:
Table 4-15 Specification format of shape name and coordinates
Shape name | Meaning | Specification of coordinates | Explanation of coordinates |
---|---|---|---|
base | Specifies base of a relative URL in a map file. | None | -- |
default | Specifies a link, when figure name is not related to poly, circle, and rect, and point is also not specified. | ||
poly | Specifies a polygon having 3 to 100 sides. | x1,y1 x2,y2 ... xn,yn | Every coordinate location of polygon (coordinate for 3 to 100 sides) |
circle | Specifies a circle. The circle specifies a center point and one point on circumference. | x1,y1 x2,y2 | Coordinates of center point and one point on circumference |
rect | Specifies a rectangle. The rect specifies 2 points of opposite corners. | x1,y1 x2,y2 | Coordinates of 2 points of opposite corners |
point | Specifies a point. The point nearest to the cursor is valid. | x1,y1 | Point |
Table 4-16 Specification values
Specification values | Meaning |
---|---|
URL | Specifies the link destination. The base and ImapBase directives are enabled in the case of a relative directory. |
map | Displays a map file menu. |
menu | |
referer | Responds with the status code 302 Found. |
nocontent | Responds with the status code 204 No Content. Valid for other than base. |
error | Responds with the status code 500 Server Error. Valid for other than base. |
The operations to use the image map are as follows:
AddHandler imap-file .map
<A HREF="/directory name/map file name"><IMG SRC="image data name" ISMAP></A>
The following figure shows an example of image map file definition and actual display:
Figure 4-13 Example of image map filedefinition
In this example, if you click on the part specified with poly, the following map file menu is displayed:
If the character set used in the map file menu differs from the default character set (ISO-8859-1), characters will become garbled in the map file menu display. In this case, specify the character set used in the map file menu in the HWSImapMenuCharset directive.