Google map addon

UPDATE: This add-on no longer works because Google has deprecated the Google Maps API v2. All users should migrate to the newer version ASAP. More info:!/thread/3802318

Use this thread from now on when discussing the map addon.

I just updated the
Google map addon
to version 0.9.2. It includes the following enhancements implemented by Petri Heinonen:


Added methods for removing a single marker and all markers
Added handler to catch marker move events that fires when a marker has been dragged to a new location. The coordinates are also available at server side from the Marker object. (feature sponsored by Propentus Oy)
Added handler to catch marker click events, works only if marker has information window content for now.

[/list]Please give it a spin and report any problems on this thread.

New version 0.9.3 is up. It has no functional changes, but instead it is now Java 1.5 compatible.

Thanks Petri!

Thank you very much!

And how about the function to provide Google Map key, instead of modifying GWT configuration.

I’m afraid that there is no schedule for the missing features, and I don’t know when someone will have the time to work on them. However, if you need the feature quickly, could your company consider sponsoring it? Contact for more information and a quote.

0.9.4 is up. Still no functional changes, just more Java 1.5 related fixes. Also tested it briefly with IE6 and added it as a compatible browser.

hey henry, where can i download the latest version? I’ve checked the official svn repo but coulndt find it.

do you also knwo that the since today an error about the api key is displayed?

I’ve got an idea, I would like to update a position on the map, initialted by the server (aka server push). is this possible with the current map plugin?

You can find both the ZIP package and source link from the
Directory page
for the add-on.

The API key is required to deploy to a production server. If the key is missing a warning message is displayed when the page is loaded, but the map should work just fine. I’m not aware of any recent change to this, and the
live demo
seems to work.

If you want to get rid of the message just get a API key for your domain, specify it in the widgetset XML and recompile the widgetset.

I’m afraid Vaadin does not (yet) include a server push mechanism, but you can easily get similar functionality using the

thanks for your quick reply. in the add on directory is the lastest versuib 0.9.3.

Yes, that’s the current version.


I’ve just finished trying your add-on just two minutes ago. For me there is no joy with any of the add-ons, if on GlassFish/Liferay. :unsure: Everything looks as same as in
this post that I’ve made for a while ago
with the only difference that I am no more getting pop-up alert, but built-in nag-screen, as follows on the screen-shot below.

And by the way, any support of their usage in NetBeans instead of Eclipse, please? :smug:

I’m confused :S

I think that your map addon issue will be fixed when you manage to resolve the problem in the abovementioned post.

Ah yes, 0.9.4 was uploaded but not published, sorry. My mistake, but it’s published now.

Hi Henri,

this looks like a great component, congrats.

But I’m noob with Widgets, so I tried a lot of things to make your component work, but nothing works.

Could you give me a help?
Is there any demo source? Tutorial? Steps?

I’m using eclipse with the vaadin plugin.


I have already put the JARs in the WEB-INF/lib. And when I click the button “Compile Vaadin Widgets” I have this message: No such file or directory
at Method)
at com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder.updateWidgetSet(

Do you know what it stands for?

Another Henri answering to this…

As there is no widgetset in your project, the widgetset builder tries to create one. This fails due to one of two possible reasons: the source directory is not writable or the widgetset is being created in the wrong directory. Also the web.xml file needs to be writable when creating a widgetset, but according to the stack trace the execution wasn’t that far yet.

If you suspect the latter might be the issue, try moving your main source path first on your classpath and retry.

If all else fails, create a MyWidgetset.gwt.xml with the e.g. contents given below (also an almost empty XML file with just the root “xml” element should work) at the location of your choice within your source tree. Note that any custom widgets you may develop in the future will be in subpackages of that location. Then select the file in Eclipse and click the compile button again. This way, you are explicitly saying where the widgetset is.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" "">
	<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
     Uncomment the following to compile the widgetset for one browser only.
     This can reduce the GWT compilation time significantly when debugging.
     The line should be commented out before deployment to production
     Multiple browsers can be specified for GWT 1.7 as a comma separated
     list. The supported user agents at the moment of writing were:
     The value gecko is used for Firefox 3 and later, gecko1_8 is for
     Firefox 2 and safari is used for  webkit based browsers including
     Google Chrome.
    <!-- <set-property name="user.agent" value="gecko"/> -->


For a very brief tutorial (which does more or less what you did), see

Hi Henri!

Congratulations to you googlemap add-on.

Unfortunatelly I have a problem with MarkerClickListener.

I added this Code, but the method never fires. Do you have an idea?

googleMap.addListener(new MarkerClickListener()
public void markerClicked(Marker clickedMarker)
System.out.println("Clicked: " + clickedMarker.getTitle());

I don’t know why, but it works now ;-). Sorry for possible annoyence.

Hi Henri,

thanks for your reply.

I could noticed that the gwt.xml file is being created, although the error in the stack trace seems to be in creating it,
there I could see that the INHERITS for the GoogleMap widgetset is not inserted:

I think it couldn’t edit the file, but I took all the precautions you told.

So I decided to try it in new Vaadin project and it has worked fine.

Don’t no why in my main project it doesn’t work, have a clue?


maybe I found a bug.

I tried with a lot of new Vaadin Projects, to find out what is the error,
and it seems to get this error when the project package is too big. Like:

I tried with uniblanc.vaadin" and it works. Both were new projects. :wacko:

hi everyone!
i’v a interesting problem when i use the marker draggable function:
when i first set marker draggable true ,and then set draggable false, all are correct,but
when i first set marker draggable false, and then set draggable true,the marker cann’t move.i must refresh the browser to get the correct result.
do you meet the problem?or mybe i 'v do something wrong?


where to configure the Google Maps API key?

I haven’t found where.