Compare the following two imagemaps: the first is implemented in Java, the second is the "sercer side" way of implementing an imagemap. To compare them, I have set up links so that the right and left arrows for each imagemap will take you to a different but same sized page. Also, compare the status feedback that you see as you move your mouse over each image.
Using Server side Imagemaps:
User Feedback
Increased download time and increased traffic on server
To minimize the size of the applet I have excluded error messages and made a few restrictions on how the imagemap data is read in. In order to debug your imagemap layout, just use MapApp2 to let you see the hot region layout.
MapApps use the same map layout as for the imagemap script used by NCSA's httpd server (as explained here). So you hopefully will not need to redo this map file, but just to copy it to a new location.
Note that some beta versions of Netscape 2.0 will not show properly the contents of the status bar - unfortunately.
MapApp1:
MapApp1: (6,291 bytes)
Applet Tag Usage for MapApp1:
The applet tag for the above applet looks something like:
Click here to download MapApp1. Place this file in your classes directory, if your applet tag has codebase="classes".
MapApp2:
MapApp2: (8,164 bytes)
Applet Tag Usage for MapApp2:
The usage is the same as MapApp1 except that you are allowed to specify the colour of the highlighted hot areas (you can use either spelling of colour or color). Valid colours are: black, gray, darkgray, lightgray, blue, cyan, magenta, green, yellow, orange, red, pink and white.
Image Map Layout File:
Restrictions:
As MapApps are Freeware, no warrantee is implied here in any sense. Therefore use them at your own risk, if any! But feel free to send me your URL so I can check out how you used it!
Java Imagemap Pros and Cons
Pros: (advantages)
No default method required
Usable on CDROM and in standalone applications
Improved security and reduced CPU overhead on server
Downloading and Using MapApps
Intro...
Two MapApps are currently available. MapApp1 provides the minimum functionality in the series. MapApp2 adds the ability for the user to see the "hot areas" by pressing on any key (while the mouse is over the imagemap).
The main interface enhancements of MapApp1 over the original imagemap are:
<applet codebase="classes" code="MapApp1" width=279 height=32>
<param name=image value="samplemap.gif">
<param name=map value="samplemap.map">
</applet>
Notes:
MapApp2 is the same as MapApp1 but with additional code to help the user find the hot areas. To see the hot areas put the mouse over the imagemap and press any key. <param name=colour value=green>
Click here to download MapApp2. Place this file in your classes directory, if your applet tag has codebase="classes".
See this reference at NCSA for more information on setting up the map file. There are some additional restrictions and flexibilities however:
Flexibilities:24,45 23, 55
Note: any errors encountered in the layout of a method (rect, poly etc.) will result in it being ignored. Therefore I recommend using the feature in MapApp2 of holding the key down to verify your layout.
MapApp Update List and Comments
To receive notification of updates and additions to the MapApp library send mail to mapapps@conveyor.com with subscribe mapapps in the subject of the message. Send comments, URLs and requests for features or bug reports to John Criswick at criswick@conveyor.com.
Other Imagemaps Out There
A small list of some other Java based imagemap applets worth checking out.