119

Do people still use the old HTML Image Maps? The ones with:

<map name="test" id="test">
<area shape="poly" alt="" title="" coords=...

Or is there a newer, better alternative?

10
  • 1
    When you ask if there's something better or not, you should give a means for comparison. Better in what way, or for what purpose? There are more powerful tools than image maps at our disposal, more complex too ... Mar 9, 2011 at 17:18
  • 4
    Good point - I haven't used an image map for a long time and thought it may have been superseded by an improved method of coding.
    – ss888
    Mar 9, 2011 at 17:23
  • 2
    Javascript/layer based functionality, and flash have replaced image maps in just about everything I come across ... I can't remember the last time I saw one in active duty. If you have a specific purpose in mind though, a more specific answer might be more readily available :) Mar 9, 2011 at 17:25
  • 26
    I'd rather avoid Flash in this day and age lol.
    – ss888
    Mar 9, 2011 at 17:27
  • 4
    If you're looking for something quick to do, fast to run, and only mildly evil, image maps will do the job. There's no widely supported replacement which will do the job at the same speed to my mind. Now if you had time for SVG, Canvas, and didn't mind excluding IE from your supported browser list ... Mar 9, 2011 at 17:30

9 Answers 9

54

Yes, people do still use image maps. An alternative would be to position elements using absolute positioning and CSS but that's not necessarily better. It also doesn't allow you to have shapes like in image maps

3
  • 1
    Ok, so html image maps are still good? How about adding hover/rollover effects?
    – ss888
    Mar 9, 2011 at 17:16
  • my major issue with image maps is that unlike the images they associate with they do not scale to browser or screen size. I would hope the OP researches SVG formats
    – Martin
    Feb 18, 2015 at 12:04
  • 2
    you have to scale it with the size of the image. Making your image size relative to the size of window. then always comparing that width/height ratio to the image map ratio, and then using javascript to overwrite the coordinates. The jquery based image size event handler is $(window).resize(function() { ....yourcode... });
    – skidadon
    Aug 11, 2015 at 3:44
46

They are in the HTML5 specification, so they will not get deprecated.

You can still freely use them, they certainly still have their place in web development. Or I could say, those rare occasions exist where you can best solve something with an image map.

24

An alternative solution to using CSS or image maps would be to make use of SVG graphics embedded into the HTML dom.

One tutorial on how to achieve mouseover effects using this technique is described in this tutorial: http://www.petercollingridge.co.uk/data-visualisation/mouseover-effects-svgs

The key takeaway being that SVG elements also trigger traditional dom events including onmouseover and onmouseout.

1
  • 2
    +1 SVG is the best direct alternative to imagemaps, as interaction can be with any arbitrary shape. Something very similar to imagemaps can be created where vector co-ordinates chop up raster pixel images, by giving SVG elements an image fill. But even then, area maps may be better in some cases (they're simpler, and don't crop the image, which might be desirable sometimes). Sep 2, 2013 at 14:39
18

Yes html image maps are good especially if you want your area to be a polygon. You can add rollover effects to you map as well with javascript. There is a nice tutorial and demo here:

http://www.tutorialized.com/view/tutorial/Image-Map-Rollover/3484

1
  • 8
    +1 -- While you can do a lot with CSS and absolute positioning, image maps are still the only way to detect hover on a non-rectangular polygon area. Dec 21, 2011 at 13:59
10

Image Maps are still in HTML5 specifications, supported by all browsers.

They can be adapted to responsive design using jQuery RWD Image Maps: https://github.com/stowball/jQuery-rwdImageMaps

It detects and automatically resize the image maps coordinates.

It's also available for Wordpress developers as plugin: http://wordpress.org/plugins/responsive-image-maps/

Simple and effective solution.

0
10

Yes, I still use image maps, however my last project used Raphaël. It was pretty easy to get something up and running.

http://dmitrybaranovskiy.github.io/raphael/

From their web site:

Raphaël ['ræfeɪəl] uses the SVG W3C Recommendation and VML as a base for creating graphics. This means every graphical object you create is also a DOM object, so you can attach JavaScript event handlers or modify them later. Raphaël’s goal is to provide an adapter that will make drawing vector art compatible cross-browser and easy.

Nice simple image map example:

http://dmitrybaranovskiy.github.io/raphael/australia.html

6
  • 3
    It wouldn't have taken much for you to fix the link yourself instead of moaning and downvoting :( Apr 3, 2016 at 11:07
  • 2
    Dear David, I removed the downvote. How do you want me to fix the link which is just simply broken? I would remove the http://raphaeljs.com/ completely and only provide the Github example.
    – orschiro
    Apr 4, 2016 at 13:49
  • 7
    The point of stack-sites is collaboration. If you see a broken link then fix it if you can. Don't think of it in terms of broken links, they are broken pointers to resources. If the resource has moved, then update the link so it points to the new location of the resource: that's the important thing. Raphaeljs used to have it's own site but it has obviously moved to GitHub. Do we send people back to Google to find where it lives now? Or do we help them go from here? The Australia example is the same example it just lives somewhere different. Apr 5, 2016 at 1:26
  • The http://raphaeljs.com/ link will eventually break when the domain registration expires but there is a re-direct on it now to give everyone (in the world) a chance to update their links. Perhaps @orschiro you could start with the one in the article and add to the collaborative effort here at SO. Apr 5, 2016 at 1:29
  • 1
    Understood, thank you David! I updated the reply and fixed the link. :-)
    – orschiro
    Apr 5, 2016 at 14:40
4

While I rarely see them used on modern websites anymore, they do seem to be used by my clients in their email campaigns. However, I've noticed, and confirmed that there are some scaling issues with the coordinate system on mobile devices.

** I know this thread is old, I was just doing some additional research into this for a recent email campaign issue and thought it may help someone else down the line.

3rd party edit

The question on litmus.com on image map support is from 04/2014

Image maps do not support ALT tags, when images aren't loaded the ALT text isn't displayed in some clients.

Image map usage generally results in using large images which can cause deliverability issues and hinder download speed (especially important to mobile users).

And most importantly, The iOS (iphone/ipad) doesn't scale the image map link coordinates when the image is scaled which breaks the links. Since iOS represents a large majority of email opens (iPhone + iPad = 38% via http://emailclientmarketshare.com/) this is important.

0

Yes, it still used

An image map allows a user to hyperlink to many pages by clicking different parts of an image.Simply by using image map we create lists of coordinates relating to a specific area of the same image and give the hyperlink to a different location. By using this within a single image we give multiple links.

More

-2

image map is quite interesting option in html and html5 they are still being use and i personally love it i therefore find issuse in mobile devices my issue is relatd to scaling

yes i have experience it my self however i am a student enrolled in html html5 and for begineers i would like to follow w3chools link

http://www.w3schools.com/html/html_images.asp

you will gain alot from this [page

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.