Google map addon

Can you please elaborate on the solution? I’m in a similar situation and cannot get this widget working. I followed the steps on your link but I don’t understand how a new gwt-maps.jar comes from it. Hosting the compiled jar somewhere would be very helpful.

Does the replacement jar need to go in the googlemapswidget.jar? Or in my project web-inf/lib/ ? Or somewhere in my tomcat install?

Hi all,
I’m fall down with this trouble too but after some googling I’ve found the correct gwt-maps.jar and I want share with all so anyone can save their time.
Just substitute the jar shipped with the add-on and recompile.

Raf
11861.jar (737 KB)

Could anyone please guide me how to add custom controls within the map, such as a button bar or even a dialog. Thanks.

Hello,

I can add my custom map type successfull. However, when I refresh the browser, the custom map type is gone. I have to make the session invalidate to make it works again.

Could someone please advice how to fix this.

My code to add the custom map type:

...
String tileURL = "http://domain.com/{ZOOM}/{Y}/{X}.png";
googleMap_1.addMapType("MyMapType", 8, 17, "MyMapType", tileURL, true, 1);
...

Thanks & Regards,
Tuan

Hi Henri,

I am intending to add custom component into Vaadin Google Map add-on from server side. After reading MapWidget.class source code in gwt-maps, I understand that I have to extend CustomControl for client-side component (override Initilize() function to return the control itself). But in VGoogleMap of add-on, I don’t see anywhere to put logic of adding custom control in the map except for the pre-defined google map built-in controls. I am extending VGoogleMap, but the ‘map’ field is private so there is nothing much I can handle.

Any help would be appreciated. Thanks in advance.

Thanks, Raf. I found it helpful.

Cheers Raf, helped me too

Hi Raf,

thanks a lot for providing the gwt-maps.jar. Solved the problem properly.

Thanks,
Florian Pirchner

redVoodo.org

when i set the icon of a marker to a custom icon. it shows at the wron position when the map is zoomed out and gets closer to the real position the further i zoom in. Any idea why that is?

icon size is 32x32 px and symmetrical

Does anyone else have a problem with custom items, that they change their position according to the zoom level and are only at the correct place when zoomed in max? Are there solutions, ideas, reasons?

Regards,
Niklas

I tried this addon and all of the listeners work as expected except the MarkerClickListener one…it never fires, as originally reported by Dirk.
Any ideas what might cause this?

Does the latest version (0.9.13) works on Vaadin 6.7.1 ?
It seems to me not working

Regards

EDIT: among the different solutions provided, the
Raffaele specia
Worked.

Thanks Raffaele (Grande)

This is an instruction/story on how to recompile gwt maps that might give you a hard time when trying to recompile the widgetset for GoogleMapWidget.
It is recompiled using the same version as the one used to compile Vaadin.


About versions used to get GoogleMapWidget up and running:

The source code of gwt-maps is v1.0.4 (or rather trunk 2011-11-15)
GWT library used to compile gwt-maps is GWT v2.3.0
Made for Vaadin versions that are compiled with GWT 2.3.0 (at least Vaadin v6.6.x and up to Vaadin v6.7.2 should work).
Made to be able to use GoogleMapWidget v0.9.13.


Compatible versions of Vaadin

Versions of Vaadin that are compiled with GWT v2.3.0 (and should be compatible) are at least:

Vaadin v6.6.x view-source:http://vaadin.com/download/release/6.6/6.6.0/release-notes.html
Vaadin v6.7.x http://vaadin.com/download/release/6.7/6.7.0/release-notes.html#dependencies
And probably all v6.7.x builds, at least up to v6.7.2…

I have only tried it out on v6.7.1 though…


How was the recompilation done?

The idea of recompilation is not my idea but rather a combined idea from “N P” and “raffaele specia” in the Vaadin forums.
https://vaadin.com/forum/-/message_boards/view_message/153177#_19_message_604784
https://vaadin.com/forum/-/message_boards/view_message/153177#_19_message_681374
Thanks guys!

I needed this as I am not using Eclipse for the moment and that the current project I am working on is solely based maven dependencies and builds.
More on using GoogleMapWidget in maven later in a another post.

Well, the “gwt-maps.jar” is compiled and built according to googles instructions:
http://code.google.com/p/gwt-google-apis/wiki/GettingStartedSource


You will need:

Java v1.5 (or later)
Ant (for executing build scripts)
Subversion (for checking out source code)


Files to download were:

http://code.google.com/intl/sv-SE/webtoolkit/download.html or rather an older version of GWT (v2.3.0)
http://code.google.com/intl/sv-SE/webtoolkit/versions.html


Files to check out:

Well, the job was quite straight forward.
I did however check out the trunk (as specified by google instructions in GettingStartedSource) of the complete google api project.
I am not sure how to check out a specific release version of gwt-maps and compile it. I did a minor attempt to do that but I did not succeed at the first and only attempt I made.

The description of building procedure is quite simple enough. Even I got it…

  • Some downloading and unzipping of files.
  • Some checking out of files from subversion.
  • Some environment variable setting.
  • And finally build execution.

Of course this is not all just a walk in the park. Of course there were some minor hickups…
Compiling straight on using v2.3.0 of GWT failed on a module (not the gwt-maps module though).
What I did as solution was that I edited the build script “build.xml” (see below) to exclude all other modules but the gwt-maps module.
Finally I ran the edited script and got success.
The final jars (binary and doc) were located in the zip-file ${checkoutdir}/maps/build/dist/gwt-maps-0.0.0.zip

I hope this information will help out in the future
/Christian Andersson
2011-11-15 (In yyyy-mm-dd date format according to http://en.wikipedia.org/wiki/ISO_8601 :wink: )


Build script “build.xml” (edited):

[size=1]
<?xml version="1.0"?>
<project name="Google API Library for GWT" default="build" basedir=".">
  <!-- "build" is the default when subprojects are directly targetted -->
  <property name="target" value="build"/>

  [color=#d4d4d4]
<!--
  <target name="search" description="Build AJAX Search">
    <ant dir="search" target="${target}"/>
  </target>
  <target name="gadgets" description="Build Gadgets">
    <ant dir="gadgets" target="${target}"/>
  </target>
  <target name="gears" description="Build Gears">
    <ant dir="gears" target="${target}"/>
  </target>
  -->
[/color]
  [b]
<target name="maps" description="Build Maps">
    <ant dir="maps" target="${target}"/>
  </target>
[/b]
  [color=#d4d4d4]
<!--
  <target name="visualization" description="Build Visualization">
    <ant dir="visualization" target="${target}"/>
  </target>
  <target name="ajaxloader" description="Build AjaxLoader">
    <ant dir="ajaxloader" target="${target}"/>
  </target>
  <target name="language" description="Build Language">
    <ant dir="language" target="${target}"/>
  </target>
  -->
[/color]

  [color=#d4d4d4]
<!-- <target name="-do" depends="gadgets, gears, maps, search, visualization, ajaxloader, language" description="Run all subprojects"/> -->
[/color]
  <target name="-do" depends="[b]
maps
[/b]" description="Run all subprojects"/>

  <target name="build" description="Builds all of the APIs that make up the Google API Library for GWT">
    <antcall target="-do">
      <param name="target" value="build"/>
    </antcall>
  </target>
  <target name="dist-dev" description="Builds development version of the APIs that make up the Google API Library for GWT">
   [color=#d4d4d4]
<!--
    <ant dir="ajaxloader" target="dist-dev"/>
    <ant dir="gears" target="dist-dev"/>
    <ant dir="gadgets" target="dist-dev"/>
    <ant dir="language" target="dist-dev"/>
    -->
[/color]
    [b]
<ant dir="maps" target="dist-dev"/>
[/b]
    [color=#d4d4d4]
<!--
    <ant dir="search" target="dist-dev"/>
    <ant dir="visualization" target="dist-dev"/>
    -->
[/color]
  </target>
  <target name="checkstyle" description="Static analysis of Google API Library for GWT source">
    <antcall target="-do">
      <param name="target" value="checkstyle"/>
    </antcall>
  </target>
  <target name="test" description="Tests all of the APIs that make up the Google API Library for GWT">
    <antcall target="-do">
      <param name="target" value="test"/>
    </antcall>
  </target>
  <target name="clean" description="Cleans the entire Google API Library for GWT build">
    <antcall target="-do">
      <param name="target" value="clean"/>
    </antcall>
  </target>
</project>
[/size]

12038.zip (1.57 MB)

Hi everyone,
I started using this addon and, for what i have to do, looks like it’ll get the job done! :slight_smile:

Anyway, i noticed a weird behaviour, when i add a content to the InfoWindow: it’ll always have a wrong width, i.e.: much wider than needed!

Moreover i was wondering if there’s the possibility of adding HTML to the InfoWindowContent.

As per the API v3 of the maps, i guess we’re not even close, right? I mean, even Google hasn’t released an official GWT wrapper…

Thanks a lot!
Iacopo

Dear Henrri Muurimaa,
I am designing a program by using Eclipe software which runs on the Ubuntu 11.10 operating system. In addition, I also apply Google App Engine and Vaadin. I am carrying out a project which is related to global positioning so I want to add Google Map to indentify coordinates. When I design ,I add Googlemapwidget to my program but there is an error : “ Point2D can’t supported Google App Engine running environment ”. Therefore, I am really graceful if you could help me deal with this problem. My email lethanhit147@gmail.com
Thank you so much.
Your sincerely,
Thanh

I’m afraid that the Google App Engine does not support using the AWT APIs at this time. The map widget uses the Point2D API to specify map coordinates, so it’d be required to rewrite those parts to make the add-on usable in GAE. This is in my TODO but I’m afraid I haven’t been able to solve it yet.

The add-on does some calculations when placing the marker, and it seems that it does not work in all cases. I’ll look into it when I get the time.

Hi to everybody.
This was solve how to create a marker and how to add it to the map.
But, how to calculate the zoom-level from the bound of the area covered by the markers?
For instance, I would like to move the map in order to fit the following area:
Minimum latitude 43°N
Maximum latitude 44°N
Mimimum longitude 16°E
Maximum longitude 17°E

Is there any method “zoomToArea(Rectangle2D)” or any workaround?
Regards

Hey, does anybody have suggestion, on how to achieve a filter on map markers?

It would be ideal if there was the possibility of adding each category of markers to a different layers, but if i got it right, layers can be used just for Poly drawing…

Using different MarkerSources?

Using separate Collections, and merging them into the MarkerSource?

Thanks a lot!

Iacopo

Hello, I’m having trouble building the widgets.
Using Eclipse Indigo, Vaadin 6.7.2, (I’ve tested it with Java 1.5 and 1.6) and still continues to display error when I try build

Fev 04, 2012 12:32:01 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO: Widgetsets found from classpath:
	org.vaadin.hezamu.googlemapwidget.widgetset.GooglemapwidgetWidgetset in jar:file:F:/Addons/googlemapwidget-0.9.13/googlemapwidget-0.9.13.jar!/
	com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:F:/vaadin-6.7.2.jar!/

Fev 04, 2012 12:32:01 PM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
INFO: Search took 4ms
Exception in thread "main" java.io.IOException: Could not create directory for the widgetset: file:F:\Addons\googlemapwidget-0.9.13\googlemapwidget-0.9.13.jar!\org\vaadin\hezamu\googlemapwidget\widgetset
	at com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder.updateWidgetSet(WidgetSetBuilder.java:79)
	at com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder.main(WidgetSetBuilder.java:52)

Can anyone help me?

The map can calculate zoom level for you given a bound (rectangle):

int zoomLevel = map.getBoundsZoomLevel(yourBounds);
LatLng center = yourBounds.getCenter();
map.setZoomLevel(zoomLevel);
map.setCenter(center);