Extending Google Maps Add-On

Hello everybody!

There has been an endless amount of feature requests for
Google Maps Add-on for Vaadin
. Really, that’s great, I’ve been extremely surprised by the popularity of the add-on. But at the same time, it has been stressing since I don’t have much time to develope the add-on. It takes enough time to keep up with the changes Google keeps making to the API while I’d still like to add all the missing features to the add-on.

Thus, at some point, I made a decision that there should be no more new features on the actual add-on. It’s too bloated already. So my mission currently is to try to keep the add-on working fine with its current feature set.

Still, there are almost endless amount of officially supported features from the JavaScrip API and both GWT and JavaScript extensions available for Google Maps that are not supported by the add-on. I want to make it possible for everyone to add new features to the actual add-on without having to modify it. The basic idea is simple: since the add-on is a Vaadin component, it should be possible to extend it by using the normal component extensions of Vaadin.

I’d like to create some examples that are simple but extensive enough so that developers wanting new features could take them as the base for their projects. I think that at least three example addons are required: one that adds a feature from normal JavaScript API, a GWT extension and finally a JavaScript-based extension.

For the JavaScript API based one, I’ve almost completed an extension that adds street view controls to the addon. It should be out soon.

But for the other two I don’t have anything ready yet. So I’m asking from the community. Do you have an idea what would be a nice feature to be added to the Maps add-on as an extension? As they will be examples I’d really like them to be something simple but useful. No other restrictions here.

Please link your suggestions here. I decided to create a new thread since the original Google Maps for Vaadin 7 thread is long enough already. In case no suggestions pop up, I guess I’ll just search for something… So in any case, some kind of examples will be out during this summer. But if there’s a feature you’d like to get to GMaps of Vaadin, now is your possibility!

Just post here what you’d like to get support for. Also links to API documents are appreciated :slight_smile:

In case you’re wondering what these extensions are about, you can, for example, read my old but still valid blog post about the topic:
Extending components in Vaadin 7
.

Marker Clustering has been one feature that has been asked for a few times. I took a quick look on it and it looks like it could be nice candidate for ja JS-based add-on. See more at
GitHub page of MarkerClusterer
.

Actually I happened to notice that there’s already a
GWT implementation for MarkerClusterPlus
as an utility library for the Branflake’s Google Maps GWT bindings that the add-on uses already. Therefore it’s my current top candidate for a GWT-based extension.

Street View extension is almost ready and I think I’m going to choose MarkerClustererPlus as the GWT example. That leaves one thing for you to give suggestions for: a JavaScript based extension.

I know that there are a lot of JS libraries that add new (and hopefully interesting) features to Google Maps. Do you happen to know a library that you would like to get support for? Please post information about it here!

Initial version of
Street View Extension is available at GitHub
. Too bad it doesn’t work as expected. First, there’s a problem if the extension is applied immediately to the map, causing NPEs and an extension that doesn’t work. My guess is that the reason for the problem is that the API loading is not ready yet and therefore the map object is not available.

So far the best solution for this that I have been able to think is that the GoogleMaps add-on should have a client-side listener system that notifies all the listening parties when the API has been loaded and the map object is ready. This should be easy to implement but naturally requires modifications to the original add-on.

Another problem is that I’ve been unavailable to catch user actions when the user moves the view while using street view. There’s a listener for changes in point-of-view but it seems to always return the default values. Currently I have no clue what’s the cause for this and how it could be fixed. I really need to investigate this further.

But first I need to fix the API loading problem so my next release will most likely be a new version of GoogleMaps Add-on.

Street View Extension v0.1 is out! Get it from
Vaadin Directory
. To my surprise, I was able to fix both issues the add-on was having and now both initializing and RPCs work as they should.

Most likely there still are bugs that I haven’t noticed. Please report all your findings either here or in the
issue tracker
.

As a side note, if you’ve already lost the track with my plan for creating example extensions for Google Maps Add-on, this Street View Extension is an example about how standard parts of Google Maps JavaScript API can be used from extensions. There are two types of extensions left:

  • A GWT based (MarkerClusterPlus is a strong candidate for this)
  • A JavaScript based (no suggestions so far, please make one :slight_smile:

Tapio,

Keep up the good work. I know how frustrating it can be when we want to do so much with the code, yet have so little time available to do so.

As for the features, if i could vote a thousand times, i would give every single vote to the mark cluster feature :wink:

Thanks for the add-on!
Jorge

Had to do quick new releases of both Google Maps add-on (1.1.1) and the Street View extension (0.1.1). Both had same issues with pom.xml, hopefully now fixed.

Just released
v0.1.2 of the Street View Extension
. Nothing new this time, just support for the modified
GoogleMapInitListener
of
GoogleMaps Add-on v1.1.2
.

Tapio, thanks for the add on. Quick question, are you still working on the current add on, no new features, just bug fixes and such?

Thanks

Hello Tapio,
I am trying to include GoggleMaps add-on in the dashboard-demo-master.
I included the dependencies in the pom.xml file and I did the maven build.
unfortunately when I launch the application, the add-on does not work, giving me the following error:
Widgetset ‘com.vaadin.DefaultWidgetSet’ Does not contain implementation for com.vaadin.tapio.googlemaps.GoogleMap. Check its component connector’sConnect mapping, widgetsets GWT module description files and re-compile your widgetset. In case you have downloaded to Vaadin add-on package, you might want to refer to add-on instructions.

I also added in web.xml:

widgetset </ param-name>
com.vaadin.demo.dashboard.DashboardWidgetSet </ param-value>
</ init-param>

and in the DashboardWidgetSet.gwt.xml file I have the following:


I think there is a problem with maven and the pom.xml file, because in other projects that use ivy repo I have no problem with this add-on.

Can you help me?
Thanks

It seems that your application is using DefaultWidgetSet instead of DashboardWidgetSet. Could you post your main UI class and web.xml here? Also are you sure that you have compiled the widgetset properly? Are charts and timeline working?

Another weird thing, a new version with a feature that I belieaved thar would never come to existence is here: you can now add any Vaadin component (yeah, layouts too) to info windows.

Notice that due architectural reasons this is done via GoogleMap#setInfoWindoContents(GoogleMapInfoWindow, Component) instead of more logical GoogleMapInfoWindow#setContent method.

But at least it seems to work! Feel free to break it and report any bugs either here or (preferably) to
GitHub
.

Also created a hax that tries to fix the Firefox marker clicking issue. Please report any findings about that too.