Untitled Document



 Introduction to HTML
 Structure of HTML
 Creating First HTML  Document
 Building Your HTML  Document
 Tables
 Frames
 Including Images into  Document
 Understanding Image  Formats
 Including Images into  Document
 Understanding Image  Formats
   GIF
 JPEG
 Adding Images
 
   Adding Images
   Adding an Images
 Setting image as a  Background
 Including Alternative  Text
 Specifying Height and  Width
   Aligning the Image
 Controlling the Border
 Using Image as Links
 
   Using Image as Links
   Creating Image Links
 Creating Thumbnails
 Creating Image Maps
 
   Creating Image Maps
 Understanding Image  Map Types
   Client Side Image Map
 Server Side Image  Map
 Image Maps and Text  Only Browsers
 Creating Server-side  Image Maps
   Creating a Map File
 Map File and the  Image Map Program
   Linking it all Together
 Creating Client-side  Image Maps
 The <MAP> and  <AREA> Tags
 The USEMAP  Attribute
 Building Web Pages
 Including Multimedia
 Developing HTML  FORMS
 Using Style Sheet
 Understanding URLs
 Using JavaScript
 Using Java

Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.




  Including Images into your Document > Creating Image Maps

  Creating Server-side Image Maps

The process for making server-side maps is virtually identical to that of making client-side image maps. The only real differences are in map file format. Each type of server can have a different type of image map configuration. In practice, only two main server-side map formats exist: NCSA and CERN.

Creating a Map File
Map File and the Image Map Program
Linking it all Together

  Creating a Map File

The heart of the server-side image map is a map file. Creating a map file involves sketching out the regions in your image that are clickable, determining the coordinates that define those regions, and deciding on the HTML pages where they should point. You can create a map file either by sketching regions and noting the coordinates by hand or by using an image map-making program.

The Mapedit and MapThis programs for Windows and WebMap for the Macintosh can all help you create map files in the NSCA format. In addition, MapThis also includes support for the creation of client-side image map definitions.

Many of the latest WYSIWYG editors for HTML pages, provide facilities for generating image maps.

If you use a UNIX-based system, there is a version of Mapedit available via FTP.

  Map File and the Image Map Program

Once you've got a map file written for your image, you'll have to install both the map file and the image map program on your server and then hook everything up in your HTML files to use the image map. You'll need your image map program installed on your server, usually in a special directory called cgi-bin, which has been specially set up to store programs and scripts for your server.

Creating the map file is the hardest part of making an image map. Most servers have an image program set up by default, and if you're using someone else's server, that program will most likely be available to you as well. The program to look for is often called htimage or imagemap.

If you are not running the most recent version of the NSCA server, you can get the new image map program from
http://hoohoo.ncsa.uiuc.edu/docs/tutorials/imagemap.txt

  Linking it all Together

For the linking purpose, you need to have an image, a map file, and image map program. In your HTML page that contains the image map, you will use the <A> and <IMG> tags together to create the effect of the clickable image. Here's an example using NSCA's image map program:

Notice several things about this link. First, the link to the image map script (imagemap) is indicated the way you would expect, but then the path to the map file is appended to the end of it. The path to the map file should be a full pathname from the root of your Web directory (everything after the hostname in your URL), in this case /maps/myimage.map.

The Second part of the HTML code that creates a server-side map is the ISMAP attribute to the <IMG> tag. This is a simple attribute with no value that tells the browser to send individual mouse-click coordinates to the image map program on the server-side for processing.

And now, with all three parts of the server-side image map in place (the map file, the image map program, and the special HTML code), the image map should work. You should be able to load your HTML file into your browser and use the image map to go to different pages on your server by selecting different parts of the map.

  Creating Client-side Image Maps

When you create a client-side image map, many of the steps for finding the coordinates of each area on the map are exactly the same as they are for creating server-side image maps. Unlike a server-side image map, however, which uses a separate file to store the coordinates and references for each hyperlink, client-side image maps store all the mapping information as part of an HTML document.

The <MAP> and <AREA> Tags
The USEMAP Attribute

  The <MAP> and <AREA> Tags

To include client-side image map inside an HTML document, you use the <MAP> (HP) tag. <MAP NAME="mapname"> coordinates and links </MAP>. Between the <MAP> and the </MAP> tags, you enter the coordinates for each area in the image map and the destinations of those regions using the same values and links. The coordinates are defined inside yet another new tag: the <AREA> tag. <AREA SHAPE="POLY" COORDS="x1, y1, x2, y2, x3, y3, [el], xN, yN" HREF="URL">. The type of shape to be used for the region is declared by the shape attribute, which can have the values RECT, POLY, and CIRCLE.

Example:

<MAP NAME="books">
<AREA SHAPE="POLY" COORDS="70,0,0,37,0,183,27192,27,48,103,9" HREF="/www/redbook.html">
</MAP>

  The USEMAP Attribute

After your client-side image map has been defined using the <MAP> tag, the last step is to put the image on your Web page. To do this, you use a special form of the <IMG> tag that includes an attribute called USEMAP. USEMAP looks like this: <IMG SRC="image.gif" USEMAP="#mapname">. Here mapname is the name of a map defined by the <MAP NAME="mapname"> tag.

Example:

<HTML><HEAD>
<TITLE>The Bookshelf</TITLE>
</HEAD><BODY>
<IMG SRC="books.gif" USEMAP="#books">
<MAP NAME="books">
<AREA SHAPE="Poly" COORDS="70,0,0,37,0,183,27192,27,48,103,9" HREF="www.redbook.html">
</MAP>
</BODY>
</HTML>

  Building Web Pages

The main problem with using client-side image maps in your Web pages is that although client-side image maps are faster and easier to implement than server-side image maps, but they're not supported by all browsers. If you do use client-side image maps, it's a good idea to also create a server-side equivalent, and then modify your HTML files so that they support both forms of image map.

To create an image map that causes client -side support, if available, but falls back to server-side support when needed, take the following standard server-side definition:

And add the client-side image map details as part of the <IMG SRC="image.gif" ISMAP> text, like this:

You will need to have installed the myimage.map file on your server and to have included the "books" <MAP> tag definition somewhere in your HTML document.

Back Next


Copyrights : Layout Galaxy All Rights Reserved
No part of this tutorial may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, electrostatic, magnetic tape, mechanical or otherwise, without prior permission in writing from Layout Galaxy.




17, Vadsarvala Nivas, 65-A, J. Nehru Road, Mulund (W), Mumbai - 400 080 INDIA
Tel : 91-22-25795588, 91-22-25780444 Fax : 91-22-25793397
Email : ionline@vsnl.com
© Image Online 2001-2003