Overview
- Server Side: This is the older method of doing image
maps. The reason for finding out what type of server you are
on is so you know what format to make your map files in.
- Client Side: These maps are implemented by placing the map coordinates in your document's HTML code. This method is supported by most modern browsers. It is much more efficient than the Server Side map in that you do not transmit mouse coordinates back to the server. Most of this page will be dealing with this type of mapping.
To keep things simple, we will be dealing with rectangular areas within an image. You are not limited to box shapes for your map areas. Circles and complex shapes are also supported. We consider this a good place to start. Once you tackle the box, the other options are pretty easy.
|
The Client Side Image Map In creating our client side map, there are three things we need:
|
The Special IMG Tag
The tag above is placed in your document where you want the map to appear. Here are the important points:
|
|
What are coordinates?
If you look at the box above, you will see that we have a nice rectangle. Within the rectangle is a smaller one. Let's call that our target. Notice that we mention only the upper left corner and the lower right. With a little internal math trick, the browser can figure out the other two corners. Thankfully the browser has more geometry knowledge then we do. Armed with this tidbit of knowledge, we can see that we are going to somehow define links with two sets of two numbers. X is considered the horizontal axis and Y is the vertical. The point 0,0 is the uppermost left corner and in the case of a 300X100 image- 300,100 is the lowest right corner. Relax, get to know the MAPTHIS program and life will be much easier.
|
|
What does the actual map code look like?
Uh, this looks really complicated. Okay. Let's chop it up a bit. The entire MAP is surrounded by the tags <MAP> and </MAP>. Notice the NAME=BALLMAP. This is the location specified in our special IMG tag. The next eight lines are comments as generated by MAPTHIS. These are control lines used by the program if you need to go back and make changes using MAPTHIS. See the DOS $PATH mentioned?
|
|
The Server Side Image Map To support browsers that can't handle client side image maps, you must install a map file on your system. It will be necessary for you to contact your system administrator for the details. The example below is an example of the NCSA format for such a file.
On our server, we indicate in the IMG tag that my MAP file is located in:
However, the file actually resides in the same directory as the HTML document that calls it. |





