Usage

To add a clickable image to a page, put this code at the place in our page you want the image to appear.

{ { {#!ImageMap
picture.jpg;width="345";height="312" 
FrontPage;shape="rect";coords="11,10,59,29";alt="Area1"
http://www.xyz.com/;shape="circle";coords="42,36,96";alt="Area2"
FrontPage/SubPage;shape="poly";coords="48,311,105,248,96,210,75,205,38,234,8,310";alt="Area3"
Another Site in This Wiki;shape="rect";coords="11,10,59,29";alt="Area4"
} } }

(Please remove spaces between brackets. This is done here only to get the code example correctly displayed. Please also note, that between the semicolons in the parameter lines, there are no spaces)

In the first line you do provide the image source and other parameters for image display. Syntax is: imgsrc[;width=".."][;heigth=".."][;alt="..."] You must provide an image source, the other parameters are optinal. imgsrc could be specified as follows:

You can display the image resized with the width and/or heigth parameters, where you can provide an alternative size for the image in pixel. With the alt parameter you can provide som alt-text for the image, i.e. some text which describes the image in some words and which is read to people using screenreaders.

In the next lines you do specify the clickable areas. Syntax is: href;shape="...";coords="...";alt="..." href gives the target to which the user will get when he clicks in the specific area. href could be specified as follows:

With the parameters shape and coords you specifiy the shape and size of the clickable regions in the image: Possible values for shape are

To figure out all these coordinates best you use WikiImageMapper (https://sourceforge.net/projects/wikiimagemapper/). WikiImageMapper is a small java-based programm which runs on the client-side. There you can load an image you want to augment with an image map and just draw or mark the regions needed like in a graphics programm. WikiImageMapper automatically produces then the ImageMapParser code needed, which could be entered easily into Moin via the clipboard (also export from the Moin editor into WikiImageMapper via clipboard is possible). Instead of WikiImageMapper you can also use a normal graphics programm to figure out the areas (normally you do get there in the statusbar the coordinates of the position of the mouse in the image). But this is some kind of hard work..

With the parameters alt and title you can specifiy an alt text or a tooltip for the clickalbe regions.

Best Practise for Accessible Wikis

To have an AccessibleMoin please note that image maps could not be used by blind people. Therefore it is important to provide a redundant list of text links underneath the clickable image.

Here are two different uses cases to clarifiy this:

Best Practise: RichFrontPage

RichFrontPage.jpg

You can use the ImageMap Parser in combination with ModernCmsTheme to provide rich wiki front pages to visitors. If the image (!) contains text which makes it clear to normal users that they shoud click into the image for further navigation you normally do omit some description above the image. You just put the clickable image and the text links underneath on the page. In this case: please do not provide an alt-text for the image as a whole so that the image is not recognized by screenreaders and blind people can get directly to the text links underneath the image.

{ { {#!ImageMap
picture.jpg;width="345";height="312" 
....

is enough. Please do always provide sensible alt-texts for the clickable regions.

Best Practise: Clickable Organisational Chart

orgchart.jpg

For some organizational charts you normally would write some text above the clickable image so that the users notice that they can also click into the image: "Click in the organizational chart for futher information or use the text links underneath". In this case please do provide an alt-text for the image as a whole, so that screenreaders could read it to the blind, e.g. "Clickable organizational chart":

{ { {#!ImageMap
picture.jpg;width="345";height="312";alt="Clickable organizational chart" 
....

Again: Please do always provide sensible alt-texts for the clickable regions.

History

   Version 1.1
    * Made code PEP8 compatible.
    * Parameter checking and stripping added to prevent inserting of malicious
      code in html page via parser call.

    Version 1.2
    * Fixed ouput abstraction violations: on other formatters than html-formatter
      just the specified image is output via formatter.image and map information
      dropped.
    * In case of missing alt texts: "alt" ist set to alt="" (for the whole map)
      and to alt="area_url" (for the different clickable areas). 
    * Now also "title" supported to generate tooltips for the map areas.
    * Interwiki links can also be specified in "wiki:MoinMoin/Page" syntax now.

MoinMoin: ParserMarket/ImageMap/ReleaseNotes (last edited 2008-01-25 19:47:13 by FedericoLorenzi)