ArticleslgStudy

science

Image map

Image map is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Image map rather than just read about it. In short: In HTML and XHTML, an image map is a list of coordinates relating to a specific image, created in order to hyperlink areas of an 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.

Image map — main illustration
Image map — illustration

Key takeaways

  • Image map belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Image map to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Image map from memory before moving on to harder problems.

Reference excerpt

In HTML and XHTML, an image map is a list of coordinates relating to a specific image, created in order to hyperlink areas of an 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.

Server-side Server-side image maps were first supported in Mosaic (web browser) version 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 <img> tag to be inside an anchor tag <a>...</a> and the <img> 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 (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 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:

the actual image, which is embedded with the <img> 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). A <map> element, and inside that, <area> elements, each of which defines a single clickable area within the imagemap. These are similar to the <a> 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. The <area> 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 desired (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 Wikipedia's home page.

CSS A more recent 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.

Creation and use

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. 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.

SVG images Because the Scalable Vector Graphics (SVG) image format provides its own mechanisms for adding hyperlinks and other, more sophisticated forms of interactivity to images, traditional image map techniques are generally not necessary when working with vector images in the SVG format.

See also Mystery meat navigation

References

Illustrations

Image map: In the SVG image, the (i) icons link to its respective bridge's article
In the SVG image, the (i) icons link to its respective bridge's article

Worked examples

Example 1 — a first encounter with Image map

Start with the simplest possible case. Write down what Image map claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Image map before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Image map ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Image map

In research
Image map appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Image map in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Image map is common in secondary-school and first-year university syllabi. It links to neighbouring topics HTML, XHTML, so understanding it makes those chapters shorter.
In everyday life
Look for Image map outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Image map” →

How to study Image map in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Image map means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Image map out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Image map in simple terms?

In HTML and XHTML, an image map is a list of coordinates relating to a specific image, created in order to hyperlink areas of an 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…

Why does Image map matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Image map?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Image map.

Tags

  • HTML
  • XHTML

Keep exploring