This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

ImageMap Plugin

Name ImageMap Plugin
Vendor Deutsche-Leasing AG (Website)
Authors Christian Wulff
Homepage http://confluence.atlassian.com/display/CONFEXT/ImageMap+Plugin
Issue Management http://developer.atlassian.com/jira/browse/IMGMP
Continuous Integration n/a
Categories Content Macros
Most Recent Version 1.6
Availability Confluence v2.0 to v2.10
State Stable
Support Unsupported Plugins
License Freeware / Open Source (BSD)
Price Free
Release Docs http://confluence.atlassian.com/display/CONFEXT/ImageMap+Plugin
Java API Docs n/a
Download Source n/a
Download JAR ImageMapPlugin_v1_0_6.jar

Description

This macro provides ImageMap functionality for pictures. ImageMaps allow to define clickable regions within a picture, that link to other pages/URLs.

Download and Installation

Compiled Plugin: ImageMapPlugin.jar
SourceCode for Plugin: ImageMapPluginSources.jar

Just install through the admin-webinterface!

This plugin now accessable through the Confluence Repository Client.

Download statistics

Date 2008-Jun 2008-Jul 2008-Aug 2008-Sep 2008-Oct 2008-Nov 2008-Dec
Hits 117 146 121 122 119 104 9

Macros

{imagemap}

Description:
Base-Plugin defining the image to use for the ImageMap.

Usage:

{imagemap:name=[somepage^someimage.jpg]}

Parameters

Name Required Description
name Specifies the link to the image to be used as an ImageMap. Can be
1) an absolute URL e.g.
'[http://www.somedomain.com/somepicture.jpg]'
or
2) a Confluence-like link to an image-attachment [somepage^somepicture.jpg]
width Specifies the width of the image.
height Specifies the heightof the image.
Be Careful
You have to use squared brackets notation for the image-link. E.g.
name=[^myimage.jpg] for an image attached to the local page

{map}

Description:
Nested Plugin defining the clickable region, the target-link and a mouse-over text.

Usage:

{map:link=[AnotherPage]|coords=x1,y1,x2,y2|title=Hello World|shape=rect}

Parameters

Name Required Description
link Target link where to go, after region was clicked.
Can be
  • an absolute URL e.g.
    http://www.google.com
    
  • a Confluence-like link [somepage]
shape Must be rect, circle or polygon. Default is rect.
coords Coordinates of the clickable region.
Depending of the shape the value must be of format
  • x1,y1,x2,y2 for ract-shapes
  • x,y,r for circle-shapes
  • x1,y1,x2,y2 ... xn,yn for polygon-shapes
title Tooltip text, that appears if the mouse stays over the clickable region
target Specifies the target-frame for the link. E.g. target="_blank" opens a link in a new Window

Example

{imagemap:name=[somepage^testpicture.jpg]}
    {map:link=[1. Geschäftliches Umfeld und Auswirkungen analysieren]|coords=120,193,224,261|target="_blank"}
    {map:link=[2. Businesslösung definieren]|shape=circle|coords=300,300,150|title='A beautifull hint-text'}
    {map:link=[3. Infrastruktur designen und planen]|shape=rect|coords=257,174,363,233}
    {map:link=http://www.google.com|coords=115,98,225,155|title='Jump to google!'}
    {map:link=http://www.theserverside.com|coords=685,98,785,157}
{imagemap}

Release History

Version Date Author Notes
1.0.0 07.12.2005 Christian Wulff Initial Version
1.0.1 09.12.2005 Christian Wulff added context-path to download-URL
1.0.2 12.12.2005 Christian Wulff added context-path to Link-URL
1.0.3 11.01.2006 Christian Wulff title-attribute added
1.0.4 14.07.2006 Christian Wulff shape-attribute added. fixed html-export bug
1.0.5 09.07.2006 Christian Wulff Fixes for IMGMP-6, IMGMP-5, IMGMP-4, IMGMP-2, IMGMP-1
1.0.6 07.10.2008 Christian Wulff height,width,target-attributes added. Removed garbage log-output

Outstanding issues

Labels

image image Delete
map map Delete
confluence20 confluence20 Delete
confluence21 confluence21 Delete
plugin plugin Delete
macro macro Delete
repository_current repository_current Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Dec 07, 2005

    Lucas Ward says:

    Thanks for adding this great plug-in, it's a much better solution that allowing ...

    Thanks for adding this great plug-in, it's a much better solution that allowing html into the page.

    I'm having a little trouble getting it to work though.  I added the plug-in through the admin interface, and then referenced it in a page, like so:

    Unknown macro: {imagemap}
    Unknown macro: {map}

    Where ADABlueprint.JPG is an attached image (it's spelled correctly).  When I go to preview or save the page, I get the standard image box with a red X in it.  I'm running Confluence 2.0, if that helps.

    1. Dec 07, 2005

      Lucas Ward says:

      Sorry, I didn't escape sequence my macro code: {imagemap:name=ADABlueprint.JPG}...

      Sorry, I didn't escape sequence my macro code:

      {imagemap:name=ADABlueprint.JPG}
      {map:link=[Batch]|coords=117,158,163,191}
      {imagemap}

      1. Dec 07, 2005

        Christian Wulff says:

        Hmm, this is strange. I can't reproduce this behaviour here. If you add the pict...

        Hmm, this is strange.
        I can't reproduce this behaviour here.
        If you add the picture with the standard Confluence-functionality e.g !ADABlueprint.JPG! is it displayed correctly then?

        What HTML-Code is generated by Confluence?

        1. Dec 07, 2005

          Lucas Ward says:

          Yes, using the starndard Confluence-functionality(!ADABlueprint.JPG!) sh...

          Yes, using the starndard Confluence-functionality(!ADABlueprint.JPG!) shows the image correctly.  Below is the html markup generated by confluence:

                              <IMG src=""
                              useMap=#MAP1133983675738> <MAP name=MAP1133983675738
                              href="/display/ADA/Batch" coords="117,158,163,191"
                              shape="rect" <area></MAP>

          1. Dec 08, 2005

            Christian Wulff says:

            Could you please tryout the Debug-Version of the plugin and post the log-output ...

            Could you please tryout the Debug-Version of the plugin and post the log-output of the catalina.log (or the standard-out of your application-server)
            It should be something like this:

            ****************************************
            Attachment: 00.jpg v.2 (34)
            filename=00.jpg
            urlpath=/pages/viewpageattachments.action?pageId=277&highlight=00.jpg#PAGENAME-attachment-00.jpg
            url=/download/attachments/277/00.jpg?version=2
            url=/download/attachments/277/00.jpg
            ****************************************

            Two additional questions:

            • Is the used attachement the initial version of this attachement?
            • Does the plugin not work at all for you (not with a different image, not in a different page) ?
            1. Dec 08, 2005

              Lucas Ward says:

              I believe I may have figured it out, I had a second look at the html source the ...

              I believe I may have figured it out, I had a second look at the html source the plug-in generated:

              <img src='/download/attachments/273/ADABlueprint.JPG?version=1'

              Now, if I compare that to html created by the wiki for an image, I get this:

              <img src="/confluence/download/attachments/283/arm_overview.gif"

              the /confluence/ is necessary, as our setup of confluence has a server url of xxx.xxx.com/confluence/,

              Maybe the plugin should use the server url property (which is accessible from the general configuration in the admin page)  This is what some of the other plug-ins do to solve this problem.

              Thanks for all of your help on this.

              1. Dec 08, 2005

                Bob Swift says:

                Probably need something like the following in the plugin String contextPath = (...

                Probably need something like the following in the plugin

                String contextPath = (new ConfluenceMockServletRequest()).getContextPath();
                String path = contextPath + attachment.getDownloadPath();

                1. Dec 09, 2005

                  Christian Wulff says:

                  Just uploaded a new version 1.0.1 of the plugin. This should fix the problem wit...

                  Just uploaded a new version 1.0.1 of the plugin.
                  This should fix the problem with the missing context-url.

                  Thank you, Bob amd Lucas for the input and suggestions.

                  1. Dec 09, 2005

                    Lucas Ward says:

                    Thanks for uploaded the new version.  I installed it on my confluence ...

                    Thanks for uploaded the new version.  I installed it on my confluence instance and the image is displayed correctly.  However, when I map a link in the image, the link doesn't have the context on it, so when you click through, it can't find the appropriate page.  I'd imagine it's a similar fix to the one Bob mentioned earlier?

                    Also, I was wondering if it might be possible to post the source code for the plugin?  I understand if that's a problem, but I thought I would ask.

                    Once again, thanks for all of your help Christian.

                    1. Dec 12, 2005

                      Christian Wulff says:

                      Uploaded the next update 1.0.2 with the fixed link-url. I also uploaded the Sour...

                      Uploaded the next update 1.0.2 with the fixed link-url.
                      I also uploaded the SourceCode. Please feel free to improve it.

                      1. Dec 12, 2005

                        Lucas Ward says:

                        I installed the latest version of the plug-in and the links now work correctly.&...

                        I installed the latest version of the plug-in and the links now work correctly.  Thanks for all of your help with the plug-in.

                        I downloaded the source zip file (btw, thanks for uploading that) but when I try and open it both winzip and winrar give an error about the file being an invalid archive.  Does anyone else have a problem opening the source zip file?

                        1. Dec 12, 2005

                          Bob Swift says:

                          Unzipped fine for me. I use 7-zip.

                          Unzipped fine for me. I use 7-zip.

  2. Dec 15, 2005

    Thomas Van de Velde says:

    When exporting a page as html, the image is broken.  I think this is becaus...

    When exporting a page as html, the image is broken.  I think this is because ?version=1 is added to the image location. Can this be fixed?

  3. Dec 16, 2005

    Lucas Ward says:

    I was having problems when using anchors with the image-map plug-in.  The f...

    I was having problems when using anchors with the image-map plug-in.  The following code:

    Unknown macro: {map}

    (#System Architecture is a valid anchor)

    generates the following html link:

    href='/collab#PrincipalTypesofArchitecture-SystemArchitecture'

    whereas simply creating a link to an anchor such as:

    [#SystemArchitecture]

    generates

    href="http://confluence.atlassian.com/display/CONFEXT/ImageMap+Plugin#PrincipalTypesofArchitecture-SystemArchitecture"

    Should there be a special case for the way the plugin handles the context path in regards to anchors?

    1. Dec 16, 2005

      Lucas Ward says:

      Sorry, [#SystemArchitecture] generated !-- href="http://confluence.at...

      Sorry,

      [#SystemArchitecture]

      generated

      !-- href="http://confluence.atlassian.com/display/CONFEXT/ImageMap+Plugin#PrincipalTypesofArchitecture-SystemArchitecture"

      1. Dec 16, 2005

        Lucas Ward says:

        Sorry about the multiple comments, the link looked fine in the preview screen, t...

        Sorry about the multiple comments, the link looked fine in the preview screen, the generated href equals "#PrincipalTypesofArchitecture-SystemArchitecture"

  4. Dec 16, 2005

    Ed Horne says:

    This could be a user error thingy but how do I get rid of the "Blue" outline on ...

    This could be a user error thingy but how do I get rid of the "Blue" outline on the image after I use this macro? I am viewing it in IE6 and the image is a .png

    Also - for a feature, how about a mouse over text?

    1. Dec 17, 2005

      Ed Horne says:

      Maybe add a comment component to the macro: {imagemap:name=testpicture.jpg} ...

      Maybe add a comment component to the macro:

      {imagemap:name=testpicture.jpg}
          {map:link=[1. Page]|comment="This is a page description"|coords=120,193,224,261}
      {imagemap}
      
  5. Jan 11, 2006

    Ed Horne says:

    Great add on the title for mouse over. One constraint with the plugin is that i...

    Great add on the title for mouse over.

    One constraint with the plugin is that it only does shape='rect'

    I added the following lines of code so that you have more degrees of freedom on the shape (poly, circle, default):

    String shapes = (String) parameters.get("shapes");
    out.append("<area shape='"+shapes+"' coords='"+coords+"' href='"+link+"' title='"+title+"'>");
    
  6. Jan 28, 2006

    Thomas Van de Velde says:

    I've tried to file this in JIRA but got an access denied error. Anyways here's t...

    I've tried to file this in JIRA but got an access denied error. Anyways here's the bug I found.

    Image map links to the attached image, as well as links to pages, are rendered incorrectly when exporting a space as HTML.

    The following breaks in an HTML export:

    <img border='0'  src='/confluence/download/attachments/4418/imagemapimage.JPG' usemap='#MAP1138440140204'>
    <map name=MAP1138440140204>
    <area shape='rect' coords='117,158,163,191' href='/confluence/display/DS/APage'></map>
    

    This is what you should get:

    <img border='0'  src='./Home_attachments/imagemapimage.JPG' usemap='#MAP1138440140204'>
    <map name=MAP1138440140204>
    <area shape='rect' coords='117,158,163,191' href='APage.html'></map>
    
    1. May 16, 2006

      Javed Mandary says:

      Hi Thomas, It seems that fo this bug the ImageMap plugin fails to associate the...

      Hi Thomas,

      It seems that fo this bug the ImageMap plugin fails to associate the correct image links to some pages. Modifying the following methods seems to correct this:
      1) In the execute() of the ImageMapPlugin class:

      ImageMapPlugin.class
      
      		Attachment att = attachmentManager.getAttachment(pc.getEntity(), name);
      		if (att == null)
      			return "the attachement could not be retrieved!";
      		String attachmentPath = renderContext.getAttachmentsPath();
      		String url = "";
      		if (null != attachmentPath) {
      			url = attachmentPath + "/" + att.getFileName();
      		} else {
      			String contextPath = (new ConfluenceMockServletRequest())
      					.getContextPath();
      
      			// String url = contextPath+att.getDownloadPath();
      			url = contextPath + att.getDownloadPathWithoutVersion();
      		}
      

      2) In the execute() of the MapPlugin class:

      MapPlugin.java
      		try {
      			link = resolver.removeLinkBrackets(link);
      			String attachment = renderContext.getAttachmentsPath();
      			if (null != attachment) {
      				link = link.replaceAll("\\+", "%20") + ".html";
      			} else {
      				Link aLink = resolver.createLink(renderContext, link);
      				if (aLink.isRelativeUrl()) {
      					link = contextPath + aLink.getUrl();
      				} else {
      					link = aLink.getUrl();
      				}
      			}
      
      		} catch (Exception lEx) {
      			lEx.printStackTrace();
      			throw new MacroException(
      					"Problem with Link: '"
      							+ lEx.getMessage()
      							+ "' link must be either an internal link (e.g. [alias|pagename@spacename]) or an external link (e.g. http://www.google.de)");
      		}
      
      1. Jun 13, 2007

        Bradley Mock says:

        Javed,  Has this code been implemented in any release?  I am receivin...

        Javed,

         Has this code been implemented in any release?  I am receiving the same error as Thomas.

  7. Feb 03, 2006

    Ed Horne says:

    there's a bug associated with this plugin in IE6 where if you use the Left Navi...

    there's a bug associated with this plugin in IE6 where if you use the Left Navigavtion Theme in a space, the hotspot is not rendered in the IE Browser

    Works great in FireFox!

    How are bugs for this plugin handled?

  8. Mar 11, 2006

    Dan Hardiker says:

    All your releases are named differently in the file name (1.0.2, 1.0.3 for examp...

    All your releases are named differently in the file name (1.0.2, 1.0.3 for example) - however all of them contain the same version number in atlassian-plugin.xml (all set to 1.0). This number should be kept in sync with the actual version number to enable plugin managing systems to operate properly.

    I would suggest that you remove 1.0.2 and rename 1.0.3 to 1.0 - keeping their contents the same (since they are already released). I'd make your next release 1.0.4 and update both the filename and the atlassian-plugin.xml file.

  9. Jul 25, 2006

    Carlos Pedraza says:

    So can't I use images that are attached to other pages? If I'm on a page other t...

    So can't I use images that are attached to other pages? If I'm on a page other than Home, I can't do this...

    {imagemap:name=Home^footer.gif}
        {map:link=[http://www.anotherwebsite.org]|coords=14,0,64,44|...etc}
    
  10. Oct 02, 2006

    Mark HM says:

    Bug/Feature request: When refactoring a page (changing the pagename), the link t...

    Bug/Feature request: When refactoring a page (changing the pagename), the link to that particular page is not updated in the ImageMap. IMHO, this feature would add value. I'm using v1.0.4. Thanks, Mark

  11. Oct 30, 2006

    mark roberts says:

    I have a home evaluation copy to test out pages that I build at work. At work, I...

    I have a home evaluation copy to test out pages that I build at work. At work, Imagemap works fine when previewing the page under edit but when browsing it as a user, the hotspots don't appear. I use IE6 at work.

    I undertake something similar on my home installation and under both Firefox and IE6, it works fine when browsing.

    At work we use the Left Navigation Theme and one previous posting mentioned there was a bug under IE6 when that theme was enabled. Because I am not an administrator at work I tried it at home and whether default or left navigation enabled, IE6 works fine on my home PC.

    Any ideas?

    Is it worth exploring and tinkering with the HTML  directly or will that mess up things within confluence?

  12. Nov 13, 2006

    David Aldrich says:

    Tried to download the ImageMap plugin today using the repository agent. Got the ...

    Tried to download the ImageMap plugin today using the repository agent. Got the following error:

    Error downloading plugin [de.dl.confluence.plugin.imagemap.ImageMapPlugin] - status code 503 returned while downloading: http://svn.atlassian.com/svn/public/contrib/confluence/imagemap-plugin/trunk/target/ImageMapPlugin_v1_0_3.jar

    Any suggestions how to fix this please?

  13. Feb 02, 2007

    Roberto Dominguez says:

    Caution If you use the Plugin installer to install this plugin, you will get an ...

    Caution If you use the Plugin installer to install this plugin, you will get an ancient version that does not support the shape parameter (hence no support for poligon or circle) So you'd have to install it by hand.

  14. Mar 05, 2007

    Raj Solanki says:

    Is there an easy way to determine the coordinates of the hot spot area in a...

    Is there an easy way to determine the coordinates of the hot spot area in an image without having to manually type in the coordinates?

    Any help would be much appreciated.

    1. Jun 25, 2007

      Frank Stiller says:

      i found this helpfull http://www.kolchose.org/simon/ajaximagemapcreator/ if you ...

      i found this helpfull http://www.kolchose.org/simon/ajaximagemapcreator/ if you have a image linkable on the internet

  15. Mar 14, 2007

    Peter R. says:

    For some reason this macro and how to use it doesn't show up when using the (mac...

    For some reason this macro and how to use it doesn't show up when using the (macro-list) macro. Any suggestions?