An image map is an image with certain areas that have been designated as
links to other documents. Image maps are a great alternative to regular anchor
tags, can contain any element that's used in anchor tags (mailto:, ftp://,
http:// etc.), can be created from any web-friendly image format and are
very easy to create and use.
Image maps come in two flavors, client-side and server-side. This document
will mainly focus on the client-side variety as they are more common and
many of the principles can be applied to server-side image maps (SSIM) as
well.
Creating a client-side image map (CSIM) is easy to do using any graphics
program. For example, using the marquee tool in Adobe Photoshop®, you
can easily gather the coordinate information for your image map. However,
there are also a few pieces of software that specialize in creating CSIMs.
MapEdit and LiveImage are two examples.
Rectangular:
First create your image and save in a web-friendly format. As an example
we'll use this image:
Next you have to define the areas that you want to use as hyperlinks.
The <map name="example"> is the name you
give to your CSIM. The image you choose should also have the name of the
map in the <img...usemap="#example"> tag.
The <area alt="Alt Text" href="Link 1" shape="rect"
coords="2,2,99,48"> is where you define the size/coordinates of
the area and where it will be linked to.
When you're specifying a rectangular shape ("rect") four coordinates;
x1,y1 and x2,y2 are required. It's easy to get these with any image editing
program using the marquee or a similar tool.
Circular:
Again, create your image first and save in a web-friendly format. We'll
use this image:
Next you have to define the area(s) that you want to use as a hyperlink.
We've chosen to just use the whole circle for this example.
When specifying a circle only three coordinates: x1,y1 and r are required.
x1,y1 is the center of the circle and r is the radius of the circle.
Polygon:
Like before, first create your image and save in a web-friendly format.
For this example we'll use this image:
Next you have to define the area(s) that you want to use as a hyperlink.
In this case, the tips of this image hyperlinks.
When creating a CSIM utilizing polygons you must give a list of coordinates
seperated by commas.