Exporting Image-Maps


These are the basic steps for creating and exporting an image-map. This page outlines how to create an image in the correct format, generate its map file, export the image-map on the server, and refer to it in an HTML document.

1. Obtain Graphic in Appropriate Format.
Graphics should almost always be of type GIF. If the application you are using to create images does not support GIF, there are converters available for several formats (see Image-Map Tools.) You should also be sure to append your filename with the .gif suffix.

2. Create Image-Map File.
Once you have your final GIF image, you need to create its map file. A map file is a text file containing descriptions of image regions along with destination URLs. You can create map files using a text editor (such as MCL) according to the CERN and NCSA formats outlined in this documentation. There are also image-map tools available for easily generating map files using a graphical interface. CL-HTTP users are advised to use the pathname extensions .ncsa-map or cern-map and the image pathname should have the same name as the map file. In a future release, CL-HTTP will autoexport these when both appear in the same directory.

3. Export Image-Map.
Here is an example call to export-url on an image-map:
(export-url #u"/my-image.gif?"
            :image-map
            :export-type :gif-image
            :pathname (pathname "http:images;my-image.gif")
            :map-format :cern
            :map-pathname (pathname "http:images;my-image.cern-map")
            :keywords '(:cl-http :demo)
            :documentation "This is my image map.")
You must place a question mark after the server pathname of you export. This tells the server to build the correct data structures for a searchable-image object. The following list defines the image-map keywords:
:image-map
This invokes the appropriate export method. It must be the first keyword.
:export-type
Specifies the type of image used. CL-HTTP will accept any of its defined export types for images.
:pathname
The pathname for the image file.
:map-format
This specifies the format of the image-map configuration file (:cern or :ncsa).
:map-pathname
The pathname for the image-map configuration file.

4. Refer to Image-Map.
To use your image-map, you must make reference to it in an HTML document. When using the HTML authoring tools, use HTML:IMAGE to emit the appropriate html.

Otherwise, you need to understand the HTML syntax for a searchable image. If the image-map is referenced without the trailing question mark, just the image contents are returned. If the question mark is present, the server treats the request as an image-map. Here is a reference in HTML to an image-map:

<A HREF= "my-image.gif?"> <IMG SRC= "my-image.gif" ISMAP> </A>
ISMAP is a standard HTML IMG attribute that tells the client to return the coordinates of a user's clicks on an image. Notice that the hyperlink reference is given the image-map, while the image source is given just the graphical element. You can also make a standing search reference:
<A HREF= "my-image.gif?34,76"> This refers to a standing search. </A>
This automatically refers to a destination specified in an image-map by passing it coordinates directly.
Back to Image-Maps on CL-HTTP
Christopher R. Vincent -- Christopher_Vincent@nospam.alum.mit.edu
M.I.T. Computer Science & Artificial Intelligence Laboratory