Google map addon

I’m not sure if the error has to do with the maps add-on. Are you sure you have everything in your classpath?

I solved the problem by switching from the add-on’s uncompiled source code (oops) to the maven dependency. Then I created an eclipse maven project, copied the gwt-maps.jar (1.1.1) to the web-inf lib and drag-n-dropped the widget jar to the web-inf/lib to trigger the autocompilation, which completed successfully. Everything worked after that.


However, this raised another question: If I created a vaadin project from the clean maven archetype, how do I trigger the widgetset autocompilation in Eclipse? Will the vaadin plugin detect drag-n-dropped addons/widgetsets?
Turns out the answer was here:
Using+Vaadin+with+Maven-UsingVaadinAddOnsWithMaven

But are there any other archetypes with widgetset compilation support out of the box?

Now I’m getting the same problem as before. Everything works if I create a new Vaadin project inside eclipse and drop the addon jars to web-inf/lib, but when I try to use the same technique for an existing maven project, I get the above errors.

What exactly do I need to have in my classpath?

I’m not big on Maven, but I understand that you shouldn’t just copy stuff to lib/. Perhaps
this post
is of help?

Okay, now I have a workaround up and running. It’s a pure Maven approach using the built-in Jetty server, which has the drawback (as far as I know, feel free to correct me on this) that you can’t run the project with Project->Run as->Run on server in Eclipse.

Here’s what I did:

  1. Add the
    googlemapwidget-0.9.13
    as a dependency to the project pom.
  2. Download the gwt-maps.jar version 1.1.1.
  3. Introduce the gwt-maps.jar as a local maven dependency using…

mvn install:install-file -Dfile=/path/to/my/jarfile -DgroupId=com.example -DartifactId=my-library -Dversion=0.1 -Dpackaging=jar -DgeneratePom=true (I don’t think you need to use any official sounding names here, but I used groupid: com.google.gwt, artifactid: maps and version: 1.1.1)
4. Use mvn in a terminal (or from inside eclipse:
Project->Run as->Maven build…
in the
Goals
text field) to run the commands: clean gwt:clean gwt:resources gwt:compile install jetty:run (I think
clean install jetty:run
might be enough)
5. Open a web browser and browse to the project root (default is localhost:8080, as set in the project pom file)

The project I got this working with uses Vaadin 6.8.2, GWT 2.3.0 and JavaSE-1.6.

Here’s a non-build/compilation related question for a change :slight_smile:

I noticed the MapClickListener doesn’t fire events when I click inside a polygon. How do I catch click events from inside polygons?

Hello Sir
i am developing my project with vaadin and by searching i find this add on.
i want real time tracking through Google maps. MY requirement is like this.
My code should get GPS coordinates from mysql data base and will show the location over google maps peroidicaly in every 30 second.
I know how to get values from data base



but i dont know how to show them over Vaadin google maps widget and change the marker position with time by removing the previous marker and redraw the new marker over new position and refresh the map without fluctuations. i mean real time tracking.

can you help me please!!

Unfortunately the Google maps add-on does not support such feature.

What you want to do is to ignore the existing marker functionality in the add-on, and write a client side extension that periodically fetches the marker data from your backend. Then, every time when you get marker data you can just remove all existing markers and redraw the ones you just got from the backend.

If you have a lot of markers (more than a few dozen) this might become a performance problem. In that case you should optimize by making sure you only fetch visible markers, and update the positions for existing markers instead of redrawing everything every time.

Thanks For Your Reply :slight_smile: i successfully managed to track any remote gps location in real time with your add on. how ever i have a question.

is there any way to show waiting icon or message until Google maps loads completely or partially when there is slow internet connection?

Hi
i recently used this version and it works perfectly with 6.7 up to 6.8.5
only you need to download the latest gwt-maps.jar file compatible with gwt 2.3.0 compiler.

replace it with the old one and cheers :slight_smile:

I’m currently trying the app out at a cloud service (CloudFoundry) but got this error when trying to paint markers on the map:

Nov 26, 2012 1:44:13 PM com.vaadin.Application terminalError
SEVERE: Terminal error:
java.lang.NullPointerException
	at org.vaadin.hezamu.googlemapwidget.overlay.BasicMarkerSource.getMarkerJSON(Unknown Source)
	at org.vaadin.hezamu.googlemapwidget.GoogleMap$1.getStream(Unknown Source)
	at com.vaadin.Application.handleURI(Application.java:798)
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleURI(AbstractCommunicationManager.java:2289)
	at com.vaadin.terminal.gwt.server.CommunicationManager.handleURI(CommunicationManager.java:370)
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleURI(AbstractApplicationServlet.java:1099)
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:535)
	at com.example.myapp.ui.CustomApplicationServlet.service(CustomApplicationServlet.java:32)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:344)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:110)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:98)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:95)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:79)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:55)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:36)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:178)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:150)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:662)

I’m using a custom application servlet extending AbstractApplicationServlet and
everything works fine on a local jetty or tomcat server
.
Any ideas what’s wrong?

Are there plans to release a version compatible with Vaadin 7 in the future?

Hi Sir,

I would like to know if there is a way to differ an one-click event from a two-click event when the user clicks on the map. Is it possible yet?
I apologize if I’m doing something wrong. I’m sort of new to this forum.

Thanks,

Arthur J.

VAADIN 7, Talk to me?

Yes, I plan to migrate the add-on to Vaadin 7 and fix at least some of the known issues as soon as I find a few days to work on it. I don’t have an ETA though, so if you really need it you should contact to sales@vaadin.com.

What is the news on Vaadin 7 support?

Still no ETA, sorry. We’re extremely busy with other stuff, so I’m afraid hobby projects remain on the back burner.

For people like me who really wanted an integration of Vaadin 7, I recently developed a simple component that integrates Google Maps v2 with Vaadin 7:


https://github.com/asarraf21/GoogleMapsVaadin7

It is not complete by any means, but it is a very good starting point to add your own functionalities.

Hello Sir,
Let me tell whether Google map Add on supports if I give Address in String format E.g: I have Address ‘45 Lawrence Ave
Lodi,07644 New Jersey, United States’ so can I find the location using this add on in vaadin

Please do not post duplicate questions. I tagged your other post for deletion.

To convert addresses to coordinates, you need to use a geocoding API - e.g.
Google has one
and there should be others available. It is not related to this Vaadin add-on, and you can use it directly from the server side. Note that there are limits to how many free queries you can do per day.