Image map widget

Hi,

I wrote a quick image map widget for Toolkit 5. Under the hood it uses FocusPanel’s over the image to capture the mouse clicks. It’s based on a GWT example I can’t find anymore.

The
source is available
and you can
try out a demo
.

Have fun with it, and please let me know if you use it to anything worthwhile :slight_smile:

Looks nice, maybe we can see this in the “Directory” someday?

You bet! Just waiting for the Directory to become available :slight_smile:

Also note that the example does not work with IE (or hosted mode browser). Any browser guru have any insights why not?

Oh, I fixed that in the version you gave me a couple of weeks ago. It’s actually used in a real™ project to great success!

If I remember correctly the bug is all due to IE’s beautiful way of always not quite working. I added a 1x1 pixel transparent gif as the background-image with repeat and everything started working.

I’ll hand you the fix tomorrow and you can update your demo.

/Jonatan

Thanks Jonatan!

Demo updated. Also added an exception when trying to add overlapping areas to the image map.

Changes in SVN (see above).

Edit: Posted to a wrong thread, moved to a separate thread…

Hello,

Since the ImageMap component is not in the 6.1.1 release, I took the liberty of making my own custom component with the source references that you gave. The image map itself works properly (clicks on the defined areas display a popup), but for the life of me I can’t get the image itself to display - not in Eclipse nor in Firefox. Any ideas where to look? I am new to Vaadin and mostly a back-end designer, but I have Swing/AWT experience as well as some jsf experience, so I think that I got things right…

Ken

Sorry. Somewhere I picked an older version of the code. The client was looking for a nonexisting “imgurl” attribute, instead of the current “image” attribute. On to, hopefully, more important things.