World Library  
Flag as Inappropriate
Email this Article

Image map

Article Id: WHEBN0000157069
Reproduction Date:

Title: Image map  
Author: World Heritage Encyclopedia
Language: English
Subject: Distributed GIS, Uniform resource locator, Imagemap Germany district AK, Imagemap Germany district AW, Las Meninas
Collection: Articles Containing Image Maps, Html, Xhtml
Publisher: World Heritage Encyclopedia
Publication
Date:
 

Image map

In HTML and XHTML, an image map is a list of coordinates relating to a specific image, created in order to hyperlink areas of the image to different destinations (as opposed to a normal image link, in which the entire area of the image links to a single destination). For example, a map of the world may have each country hyperlinked to further information about that country. The intention of an image map is to provide an easy way of linking various parts of an image without dividing the image into separate image files.

Contents

  • Server-side image map 1
  • Client-side image map 2
    • Pure HTML 2.1
    • CSS 2.2
  • Image maps use 3
  • References 4
  • Tutorials & Weblinks 5

Server-side image map

Server-side image maps were first supported in Mosaic (web browser) version 1.1.[1] Server-side image maps enable the web browser to send positional information to the server about where the user clicks within an image. This allows the server to make pixel-by-pixel decisions about what content to return in response (possible methods are to use image mask layers, database queries, or configuration files on the server).

The HTML code for this type of server-side image map requires the tag to be inside an anchor tag ... and the must include the ismap attribute.


When the user clicks inside the image the browser will append the X and Y coordinates (relative to the upper-left corner of the image) to the anchor URL as a query string and will access the resulting URL[2] (for example, /imagemapper?3,9).

If the browser does not support ismap then the query string must not be added to the anchor URL and the server should respond appropriately (for example, by returning a text-only navigation page).

Client-side image map

Client-side image maps were introduced in HTML 3.2, and do not require any special logic to be executed on the server (they are fully client-side). They also do not require any JavaScript.

Pure HTML

A client-side imagemap in HTML consists of two parts:

  1. the actual image, which is embedded with the tag. The image tag must have an attribute usemap, which names the imagemap to use for this image (multiple imagemaps may exist on a single page).
  2. A element, and inside that, elements, each of which defines a single clickable area within the imagemap. These are similar to the tag defining which URL should be opened for an ordinary web link. A title attribute may be provided, which may be rendered as a tooltip if a desktop user hovers their mouse pointer over the area. For web accessibility reasons, it is often important – and in some cases it may even be a legal or contractual requirement – to provide an alt attribute describing the link that screen reader software can read to, for example, blind users.[3]

The elements can be rectangles (shape="rect"), polygons (shape="poly") or circles (shape="circle"). Shape-Values are coordinate-pairs. Every pair has an X and a Y value (from left/top of an image) and is separated with a comma.

  • Rectangle: Set four coordinates: x1,y1,x2,y2
  • Polygon: Set as many coordinates as you want (a multiple of two): x1,y1,x2,y2, [...] xn,yn
  • Circle: One coordinate-pair and another value with a radius: x1,y1,radius

The following example defines a rectangular area (9,372,66,397). When a user clicks anywhere inside this area, they are taken to the English WorldHeritage's home page.

Website map

  WorldHeritage

CSS

A more modern approach is to overlay links on an image using CSS absolute positioning; however, this only supports rectangular clickable areas. This CSS technique may be suitable for making an image map work properly on iPhones, which can fail to rescale pure HTML image maps correctly.

Image maps use

Image map example of The Club. Clicking on a person in the picture causes the browser to load the appropriate article.

It is possible to create client-side image maps by hand using a text editor, but doing so requires web designers to know how to code HTML as well as how to enumerate the coordinates of the areas they wish to place over the image. As a result, most image maps coded by hand are simple polygons.

Because creating image maps in a text editor requires much time and effort, many applications have been designed to allow web designers to create image maps quickly and easily, much as they would create shapes in a vector graphics editor. Examples of these applications are Adobe's Dreamweaver or KImageMapEditor (for KDE), and the imagemap plugin found in GIMP.

Image maps which do not make their clickable areas obvious risk subjecting the user to mystery meat navigation. Even when they do, where they lead may not be obvious. This can be partially remedied with rollover effects.[4]

References

  1. ^ "IMG extension for Mosaic 1.1". 
  2. ^ "HTML: The Markup Language (an HTML language reference)". 
  3. ^ "Image Maps in HTML". AccessAbility.  
  4. ^ Flanders, Vincent (March 1998). Web Pages That Suck: Learn Good Design by Looking at Bad Design. San Francisco: Sybex Inc.  

Tutorials & Weblinks

  • CSS Image Map Techniques and Tutorials Tutorial Design Reviver
  • Imagemap Generator, Generator for HTML Imagemaps
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and USA.gov, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for USA.gov and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
 
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
 
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.
 


Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.