Google map addon

Hello,

when is this version going to be released? This is a very much needed functionality otherwise it means recompiling the widgetset for every application every time the servername changes, right?

Btw, we also see the bug here with markers not beeing drawn when a marker with the same id has been removed before.

Regards
Andreas

I just
published new version 0.9.7
which features the API key support and fixes to several problems mentioned in this thread. Please give it a whirl it and report any problems.

[quote=Henri Muurimaa]
I just
published new version 0.9.7
which features the API key support and fixes to several problems mentioned in this thread. Please give it a whirl it and report any problems.
[/quote][u]

[/u]

Hello Henri,

it works now, though you probably made a small mistake in packaging the jar-file you get when clicking the “download” button. I think this should be the zip-file, as the jar itself is contained in this.

Regards
Andreas

Hello Henri,

another thing: please remove the easteregg from the client-code. It gives a warning in the server logs because the icon will not be found if you are using a custom theme :slight_smile:
Besides it irritates customers to see a location marker on the map which doesn’t belong to them.

Regards
Andreas

Thanks Andreas, I removed the easter egg and uploaded 0.9.8 as a zip package.

Thank you Henri,

as another thought could you also please remove the display of the log and error messages in …/widgetset/client/ui/VGoogleMap.java or perhaps add an attribute to enable/disable them in a future version?

Cheers
Andreas

Would if suffice if the messages were tied to the Vaadin production mode?

Hello Henri,

I think that hardly anybody except those implementing new features or tracing bugs will really need these messages.
So how about this? This way you can even configure the granularity of the logging messages.

Regards
Andreas
11370.java (21 KB)
11371.java (27.6 KB)

That’s even better :slight_smile: Released 0.9.9, which includes your patch. Thanks!

Hi, I am checking out Vaadin and so far I am impressed.
However, I got into trouble when trying to use the Google map add-on.
I am using Netbeans 6.9, Vaadin 6.4.1, GWT 2.0.4
I compiled the add on and everything looked fine, but when I run the app I get this error in Tomcat:

WARNING: Cannot serialize session attribute com.vaadin.terminal.gwt.server.WebApplicationContext for session 4ED8ACA9A007156EEFD86B1E0E93F44F
java.io.NotSerializableException: org.vaadin.hezamu.googlemapwidget.overlay.BasicMarker
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1156)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at java.util.ArrayList.writeObject(ArrayList.java:570)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1461)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1392)

and in the browser

Widgetset does not contain implementation for org.vaadin.hezamu.googlemapwidget.GoogleMap. Check its @ClientWidget mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions. Unrendered UIDL:

org.vaadin.hezamu.googlemapwidget.GoogleMap(NO CLIENT IMPLEMENTATION FOUND)

Did I forget to do something ?

Thank you

This warning should not have any effect outside the log message, but I’ll make the class serializable in the next update.

Did you compile the widgetset after adding the addon to your project? Our Eclipse plugin makes that easy, but with other IDEs you need to do it by hand. For Netbeans see
this article
.

I just uploaded 0.9.10 which fixes a bug with marker icon handling and features a new API to position the icon.

There seems to be a bug in the Directory which makes it think that 0.9.9 is newer than 0.9.10. Until it’s fixed you can download the latter using the version dropdown on the addon page.

Hi,
I would like to know how to avoid GWT Re-compilation each time i try to deploy changes,
Is it really necessary ?
I followed the tutorial to install add-ons using maven, creating MyAppWidgetSet.gwt.xml,
and it works ! it honestly works,
but it’s re-compiling each time i make a change, taking 2-3 minutes or more…
If i remove this dependency to this xml (in web.xml) and rename the xml in (.xml.old) to avoid being scanned,
the google map plugin doesn’t work :

Widgetset does not contain implementation for org.vaadin.hezamu.googlemapwidget.GoogleMap. Check its @ClientWidget mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions. Unrendered UIDL:

All in all, What is the best way ? Is it avoidable ? Or is there any way to ease the pain… ?

thank you for your time, and once again thank you for your contribution

The GWT compile step is only required if you change clientside implementation (eg. VGoogleMap.java). If you are working on your server side code which usually is the case, you shouldn’t ever need to compile the widgetset.

I’m not too familiar with Maven, perhaps someone with experience in that can say what’s the problem?

When you say “Client side” let’s assume that i’ve got an Application class, that deals with GoogleMap objects. Is it client-side implementation ?
I’m not modifying any class of the library…

I talked with michu about that : http://www.neophob.com/2010/05/vaadin-maven2-and-widgets/
and there may be a problem with the way we understand… what needs to be compile…

But as i told when i remove the “gwt” client side compilation of the class dealing with GoogleMap objects, the add-on doesn’t work anymore… i may be missing something.

This is not in any way specific to the Google maps add-on, but a general problem with the GWT Maven plugin or its configuration in the Vaadin archetypes - it does compile the widgetset too aggressively, also when the changes should not affect the client side.

I suggest taking this discussion to a separate thread if necessary. I had the recollection there was another recent thread about this, but I could not find it quickly.

I also created
ticket 5416
to track this issue. I will have to see if I manage to analyze the problem in more detail before going on vacation. It might be anything from a misconfiguration to how JARs are re-copied to the target directory and seen as dirty…

Ok then it’s specific to maven way of handling gwt re-compilation. Just for information, does the Vaadin plugin for eclipse handle it in a better way, or is recompilation also “agressive” ?

Thank you for your time henri(s) i’ll try to test it myself to help resolve ticket 5416

By the way Henri, (sorry to change the main subject), Is there a way of drawing polygons (zones) on a google map object ? I’ve seen the Polygon object in the overlay package, but no way of handling it ?

The Eclipse plugin is a little aggressive, but not to the same extent as the current Maven archetypes. It cannot determine whether a JAR removed from the project might or might not have contained something that affects the widgetset, which might trigger unnecessary GWT compilation. Also, any changes to the server-side counterparts of client-side widgets (i.e. classes with the @ClientWidget annotation) trigger re-compilation, even though technically only changes to the annotation itself require widgetset compilation.

Nevertheless, after learning how widgetset compilation works, many Eclipse users do turn off the automatic recompilation and instead trigger the compilation by hand when they know a batch of changes is finished.

No, please discuss anything related to the map addon in this thread.

You create a Polygon or PolyOverlay (which is a polyline) and add it to the map. Here’s an example that draws an ugly blue rectangle with a red border over the Vaadin Ltd offices in southern Finland:

Point2D.Double c = new Point2D.Double(22.3, 60.4522);
						
double delta = 0.75;
						
Point2D.Double[] corners = new Point2D.Double[]
 {
     new Point2D.Double(c.x - delta, c.y + delta),
     new Point2D.Double(c.x + delta, c.y + delta),
     new Point2D.Double(c.x + delta, c.y - delta),
     new Point2D.Double(c.x - delta, c.y - delta),
     new Point2D.Double(c.x - delta, c.y + delta)
};

Polygon poly = new Polygon(new Random().nextLong(), corners, "#f04040",
     5, 0.8, "#1010ff", 0.2, false);

googleMap.addPolyOverlay(poly);

Even though the corners form a square the result will appear to be an elongated rectangle. This is because of the Mercator projection system used by the map. The first corner is also the last so that the map will close the border.