yesh
yesh

Reputation: 2070

Not able to use Google Maps V3 with GWT

I am trying to get Googlemaps v3 to work with Google web tool kit. I am using GWT 2.5.1. I have been trying to search for the lastest release of Google Maps with GWT and ended up on this page. As per there instructions I have downloaded those 3 jar files.

gwt-maps-api-v3-3.8.1-javadoc.jar
gwt-maps-api-v3-3.8.1-sources.jar
gwt-maps-api-v3-3.8.1.jar

I have placed those jar files in my WEB-inf enter image description here

I have added those jar files to my class path enter image description here

In my map_geolocation.gwt.xml I have inherited the module.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to="map_geolocation">
    <inherits name="com.google.gwt.user.User" />
    <inherits name="com.google.maps.gwt.GoogleMaps" />
    <source path="client" />
    <entry-point class="com.google.maps.gwt.samples.basics.client.MapGeolocation" />
</module>

When i try to run my code I get this error.

Loading modules
   com.google.maps.gwt.samples.basics.map_geolocation
      Loading inherited module 'com.google.maps.gwt.samples.basics.map_geolocation'
         Loading inherited module 'com.google.maps.gwt.GoogleMaps'
            [ERROR] Unable to find 'com/google/maps/gwt/GoogleMaps.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
         [ERROR] Line 6: Unexpected exception while processing element 'inherits

After doing some research I inherited

<inherits name='com.google.gwt.maps.Maps' />

instead of

<inherits name="com.google.maps.gwt.GoogleMaps" />

Still it fails. Does anyone know what is going on ?

UPDATE : I am not concerned with using V3. Where can I find the stable latest Google map plugin for GWT ?

Upvotes: 2

Views: 3505

Answers (1)

user2116390
user2116390

Reputation:

1- You only need a jar, download last version from maven repos, and put in your classpath just one jar: gwt-maps-api-3.10.0-alpha-6.jar

2- gwt-maps-api depends on gwt-ajaxloader so download it as well, uncompress it, and add the gwt-ajaxloader.jar file to your classpath.

3- Check that you are inheriting the correct module in your .gwt.xml file:

<inherits name='com.google.gwt.maps.Maps' />

4- Normally, in your eclipse, the classpath of the GWT sdk should be before than 3party libraries

5- The [ERROR] Unable to find '....gwt.xml' on your classpath is always a problem of classpath. There is plenty of answers in stackoverflow about this common problem.

After doing this, if your problem persists, try to remove the 'run as' configuration of your project and set it up again.

Upvotes: 4

Related Questions