An Image Map is simply a menu in graphical form. Areas of an image map graphic are "mapped" with linkages to parts of a Web site or other URLs. When you point your mouse and click on a portion of an image map, the coordinates you selected are translated into a destination based on information stored in a related map file. All you need to create an image map is a *.gif or *.jpg image and one of the many image mapping programs available for the Windows environment.
|
In simple terms, a Client Side Image Map uses the built in capabilities of some web browsers (such as the PRODIGY Web Browser) as an engine to translate the coordinates and request the referred URL or file. A Server Side Image Map (such as the NCSA format supported by the servers used for Personal Web Pages) must send a request to the remote server and use the capabilities of the remote server to request the URL or file referenced by the map coordinates. Client Side Image Maps can be faster than Server Side Image Maps because they do not depend on the CPU load on the server. |
If you view the source for this page, you'll see that we've included the Client Side Image Map as part of this page's HTML code.
Client Side Image Maps can either be separate *.htm or *.html files or can be embedded on a page with other code (such as our sample here).
<MAP NAME="MapDemo"> <AREA SHAPE=CIRCLE COORDS="60,106,37" HREF=http://galadriel.ecaetc.ohio-state.edu/tc/mt ALT="this is the URL for MapThis 32 Bit"> <AREA SHAPE=RECT COORDS="111,66,190,144" HREF=ftp://sunsite.unc.edu/pub/packages/infosystems/WWW/tools/mapedit/mapedit.zip ALT="This is the FTP site for MapEdit"> <AREA SHAPE=POLY COORDS="199,70,210,77,215,61,227,67,265,57,264,81,297,105,273,115,262,157,224,135,203,144,208,117,201,94,210,87,199,70,199,70" HREF=#Hotspots ALT="This is the link to the bookmark for HotSpots"> <AREA SHAPE=default HREF=http://pages.prodigy.com/beta/imagemap.htm> </MAP> |
Any of the recommended image mapping programs can create an NCSA format map file like the sample below.
default http://pages.prodigy.com/imagemap.htm rect http://pages.prodigy.com/imagemap.htm#Hotspots 206,62 269,128 rect http://galadriel.ecaetc.ohio-state.edu/tc/mt 28,66 101,135 rect ftp://sunsite.unc.edu/pub/packages/infosystems/WWW/tools/mapedit/mapedit.zip 115,65 194,136 |
In our sample on this page, we've used BOTH a Client Side Image Map and a server side map. This insures that visitors to this page will be able to select the hotspots in our sample map even if the browser they are using doesn't have Client Side Image Map capabilities.
Browsers which include the capability to use a Client Side Image Map will use the client side coordinates first and ignore the server side reference. Other browsers will use the NCSA format image map reference. Once your map file is ready, you'll need to insert an image map reference (or references) on your page. Here's how the reference for the sample map on this page is constructed:
<A HREF="map2.map"><IMG SRC="mapdemo.gif" ISMAP USEMAP="#MapDemo" HEIGHT=211 WIDTH=316 ALIGN=TOP BORDER=0 ALT="Image for Map Tutorial"></A> |
HTML Hints