Image maps create areas (rectangular areas being the most accepted) which can be linked to other pages or sites. The use of the MAP and AREA tags define the areas in the image. You add usemap="#areaname" parameter to your IMG tag to apply an image map to it. Image map format is described below. You can create an image map by hand by counting pixels, or use one of the many tools available on the net to create the maps. Another map editor, which is freeware, is MapMaker 32 from Martin E. Haring.
Mapedit, from Boutell is a WYSIWYG editor for client-side imagemaps. Get the evaluation version of Mapedit here. This tool will update the IMG tag and add the appropriate MAP and AREA tags in your HTML code automatically.
Get a copy at:
MapMaker32 version 2.0b
This program creates the MAP tags for your image, which you paste into your HTML.
Place the cursor over a color and click the mouse to select which color to go to. |
SHAPE describes an area in the image and can be circle, rect (for rectangle), polygon (for triangles or other odd shaped areas), or default
REFERENCE is the URL of the page to go to when that area is picked (noref says don't go anywhere) x,y are the coordinate pairs for the corners of the areas (for the circle it is x, y, amd the radius of the circle (all in pixels)
(x is the horizontal dimension (0 at the left to 199) and y is the vertical (0 at the top to 99).)
If some of the figure does not have an area defined, then the "default" shape will tell where the user will be taken when the mouse is clicked over that area (in this example, you won't go anywhere because the value is set to nohref, which tells the browser to ignore mouse clicks over an area.)
The HTML (created by Mapedit) to map the image above is:
<map name="area">
<area shape="rect"
coords="123,8,171,57" href="blue.htm">
<area shape="circle" coords="94,73,25" href="yellow.htm">
<area shape="polygon" coords="9,44,44,9,79,44,9,44" href="red.htm">
<area shape="default" nohref>
</map>
Here is the image tag for the image shown above has a pointer to the image map in the usemap parameter (usemap="#area"):
<IMG SRC="cube.gif" WIDTH="70" HEIGHT="70" BORDER="0" ALT="Map to color pages" usemap="#area" ALIGN=top>
NOTE: If you came here from the Web Tutorial, a new browser window was be opened for viewing this page. To return, you can just select the other browser (from the task bar in Windows 95 or click your mouse somewhere on its window). You can also close (or File, Exit) from this window when done.
Copyright © 1998 Jim Hanson Last update: Jan. 7, 1998.