GWT and Google Maps Version 3

1,504 views
Skip to first unread message

andrew

unread,
Feb 14, 2012, 5:20:24 AM2/14/12
to Google Web Toolkit
I currently use GWT Maps API 1.1 in our GWT APP and I'd like to update
it to use the Google Maps API Version 3.

Is there a supported, not deprecated, library for GWT to use Google
Maps API V3?

gwt-google-maps-v3
===============
http://code.google.com/p/gwt-google-maps-v3/
Only one committer. Seems abandoned.
Latest downloadable JAR is from May 2010.
Not compiled for GWT > 2.2 and so fails on latest GWT2.4 (someone
posted a new version)
Says "This project will soon be merged into gwt-google-apis and hence
is depricated", but that comment could be pretty old by now.

gwt-google-apis
===========
http://code.google.com/p/gwt-google-apis/
Would seem to be the official and logical place to look.
But it states: "At the present time, the gwt-maps API only supports
Google Maps API version 2."
and the Libraries for GWT versions 1.0 and 1.1 (uses GMaps API V2) are
both listed as deprecated.
Release Notes (1.10) was last updated on May 2010.

I was convinded this would be the place to find it, and searched but
with no luck. Am I missing something?

I also found:

gwt-maps3
========
http://code.google.com/p/gwt-maps3/
This seems more up-to-date than gwt-google-maps-v3 and, but less
extensive and not Google "approved"?

If I'm going to rewrite for a new API, I'd like it to be the
"definitive", if possible Google sanctioned one, and not face another
re-write shortly after.

Thanks for any help.

Patrice De Saint Steban

unread,
Feb 14, 2012, 9:26:41 AM2/14/12
to google-we...@googlegroups.com
Hello,

There are a new in progress wrapper of the Gwt Maps v3


with demo :

I not tested this implementation, I use the gwt-google-maps-v3 project with jsni for error or missing fonction.

Patrice

Joseph Lust

unread,
Feb 14, 2012, 9:30:58 AM2/14/12
to Google Web Toolkit
The lack of deprecated V3 is maddening for GWT and Maps V3. Check out
the below. It is the only one I know of.

There is a nearly finalized V3 API on googlecode http://code.google.com/p/gwt-maps-api/
. It has every facet of the JS API and is fully functional right now.
I'm using it without issue. Feel free to check it out of SVN and build
it.


Joe

On Feb 14, 5:20 am, andrew <andrew.macken...@bcntouch.com> wrote:
> I currently use GWT Maps API 1.1 in our GWT APP and I'd like to update
> it to use the Google Maps API Version 3.
>
> Is there a supported, not deprecated, library for GWT to use Google
> Maps API V3?
>
> gwt-google-maps-v3
> ===============http://code.google.com/p/gwt-google-maps-v3/
> Only one committer. Seems abandoned.
> Latest downloadable JAR is from May 2010.
> Not compiled for GWT > 2.2 and so fails on latest GWT2.4 (someone
> posted a new version)
> Says "This project will soon be merged into gwt-google-apis and hence
> is depricated", but that comment could be pretty old by now.
>
> gwt-google-apis
> ===========http://code.google.com/p/gwt-google-apis/
> Would seem to be the official and logical place to look.
> But it states: "At the present time, the gwt-maps API only supports
> Google Maps API version 2."
> and the Libraries for GWT versions 1.0 and 1.1 (uses GMaps API V2) are
> both listed as deprecated.
> Release Notes (1.10) was last updated on May 2010.
>
> I was convinded this would be the place to find it, and searched but
> with no luck. Am I missing something?
>
> I also found:
>
> gwt-maps3
> ========http://code.google.com/p/gwt-maps3/

nandy

unread,
Mar 14, 2012, 11:59:03 AM3/14/12
to Google Web Toolkit
Hi,

I find that most demos don't seem to work on IE9.

On Feb 14, 7:30 pm, Joseph Lust <lifeofl...@gmail.com> wrote:
> The lack of deprecated V3 is maddening for GWT and Maps V3. Check out
> the below. It is the only one I know of.
>
> There is a nearly finalized V3 API on googlecodehttp://code.google.com/p/gwt-maps-api/

nandy

unread,
Mar 14, 2012, 11:59:32 AM3/14/12
to Google Web Toolkit
Hi,

I find that most demos don't seem to work on IE9.

On Feb 14, 7:30 pm, Joseph Lust <lifeofl...@gmail.com> wrote:
> The lack of deprecated V3 is maddening for GWT and Maps V3. Check out
> the below. It is the only one I know of.
>
> There is a nearly finalized V3 API on googlecodehttp://code.google.com/p/gwt-maps-api/

Joseph Lust

unread,
Mar 15, 2012, 6:09:40 PM3/15/12
to google-we...@googlegroups.com
Nandy,

Your error is with  http://code.google.com/p/gwt-google-maps-v3/ , which does not utilize the complete Maps V3 JS API. However, when I tested the demo page for  http://code.google.com/p/gwt-maps-api/ , everything appeared to work fine on IE9.

Sincerely,
Joseph

John99

unread,
Jun 21, 2012, 9:09:52 AM6/21/12
to google-we...@googlegroups.com
Hello. what about events propagation from infowindow? seems it does'nt work for now.
Thanx

пятница, 16 марта 2012 г., 2:09:40 UTC+4 пользователь Joseph Lust написал:

Blaze

unread,
Jun 21, 2012, 10:44:41 AM6/21/12
to Google Web Toolkit
Hi all,


I use the http://code.google.com/p/gwt-maps-api/ and its working all
ok, but there are couple of things
bothering me:

1. When the map is loaded for the very first time all looks ok, no
error in the console, but the map is not there.
Then if you reload the page all looks ok, and after this the map loads
corectlly all the time. (looks like something is cached)
Not a big problem, but its there...

2. On the load of the map in the chrome console when a persion try to
zoom and move the map around there are a lot of wornings:

Resource interpreted as Image but transferred with MIME type
application/octet-stream: "http://cbk0.googleapis.com/cbk?
output=cbrep&ed=67%3A2%3B1%2C&s=64293&cb_client=apiv3&v=4&hl=en-US".
Resource interpreted as Image but transferred with MIME type
application/octet-stream: "http://cbk0.googleapis.com/cbk?
output=cbrep&ed=67%3A2%3B1%2C&s=15127&cb_client=apiv3&v=4&hl=en-US".
Resource interpreted as Image but transferred with MIME type
application/octet-stream: "http://cbk0.googleapis.com/cbk?
output=cbrep&ed=67%3A2%3B1%2C&s=81157&cb_client=apiv3&v=4&hl=en-US".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_viewport&cad=src:apiv3,ts:1340028221898".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_ads&cad=src:apiv3,ads:1".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_viewport&cad=src:apiv3,ts:1340028225184".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_viewport&cad=src:apiv3,ts:1340028225847".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_viewport&cad=src:apiv3,ts:1340028227265".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_viewport&cad=src:apiv3,ts:1340028227849".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_marker&cad=src:apiv3,m:3,d:0,s:2".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_marker&cad=src:apiv3,m:2,d:0,s:0".
Resource interpreted as Image but transferred with MIME type text/
html: "http://maps.googleapis.com/maps/gen_204?
ev=api_marker&cad=src:apiv3,m:2,d:0,s:0".


Then if the maps is leaved open in the browser for a couple of
hours(or one day the way I testi it) while do move of map zoom etc..
in the console are thrown this errors:

GET
http://maps.googleapis.com/maps/api/js/ViewportInfoService.GetViewportInfo?1m6&1m2&1d-90&2d-180&2m2&1d90&2d180&2u3&4sen-US&5e3&6sh%40177000000&7b0&8e0&9b0&callback=_xdc_._p65mew&token=13911
403 (Forbidden) %7Bmain,adsense,drawing,geometry,panoramio,places
%7D.js:11
GET
http://maps.googleapis.com/maps/api/js/ViewportInfoService.GetViewportInfo?1m6&1m2&1d-64.52471476314135&2d-180&2m2&1d90&2d180&2u3&4sen-US&5e3&6sh%40177000000&7b0&8e0&9b0&callback=_xdc_._e5513&token=73455
403 (Forbidden)


This same behaver I found happaning in my implementation and in the
demos here: http://gonevertical-apis.appspot.com/

Any idea by someone...?!
Or its more a question for the google maps api...

Blaze


On 21 Jun., 15:09, John99 <smy...@gmail.com> wrote:
> Hello. what about events propagation from infowindow? seems it does'nt work
> for now.
> Thanx
>
> пятница, 16 марта 2012 г., 2:09:40 UTC+4 пользователь Joseph Lust написал:
>
>
>
>
>
>
>
>
>
> > Nandy,
>
> > Your error is with  http://code.google.com/p/gwt-google-maps-v3/, which
> > does not utilize the complete Maps V3 JS API. However, when I tested the
> > demo page for  http://code.google.com/p/gwt-maps-api/, everything

Joseph Lust

unread,
Jun 21, 2012, 10:39:20 PM6/21/12
to google-we...@googlegroups.com
John99,

Which event on InfoWindow is not working for you. There are five handlers exposed to GWT from the 5 handlers documented for InfoWindow in the GMaps API. Please elaborate.


Sincerely,
Joseph

John99

unread,
Jun 22, 2012, 3:04:14 AM6/22/12
to google-we...@googlegroups.com
I have a button on InfoWindow. and ClickEvent doesn't work. I think it because of infowindow doesn't attach this button to DOM correctly. I've made a wraper whis fake panel and now it works ok.

public class NGTInfoWindow {

    static class FakePanel extends ComplexPanel
    {
        public FakePanel(Widget w)
        {
            // Detach new child from anything it was attached to before.
            w.removeFromParent();
            // Adds to our collection
            getChildren().add(w);
            // Results in the actual attachment
            adopt(w);
        }

        @Override
        public boolean isAttached()
        {
            return true;
        }

        /** Detaches the widget */
        public void detachWidget()
        {
            this.remove(0);
        }
    }

    private static final Logger log = Logger.getLogger(NGTInfoWindow.class.getName());

    private InfoWindow infoWindow;

    private FakePanel widgetAttacher;

    public NGTInfoWindow(InfoWindowOptions options){
        this.infoWindow = InfoWindow.newInstance(options);
    }

    private void detachWidget()
    {
        if (this.widgetAttacher != null)
        {
            this.widgetAttacher.detachWidget();
            this.widgetAttacher = null;

            log.log(Level.SEVERE, "detachWidget");
        }
    }


    public void setContent(Widget value)
    {
        infoWindow.setContent(value.getElement());

        if (this.widgetAttacher == null)
        {
            // Add a hook for the close button click
            infoWindow.addCloseClickHandler(new CloseClickMapHandler(){

                @Override
                public void onEvent(CloseClickMapEvent closeClickMapEvent) {
                    detachWidget();
                }

            });


            /*this.jso.addListener("closeclick", new Runnable() {
                @Override
                public void run()
                {
                    detachWidget();
                }
            });*/
            this.widgetAttacher = new FakePanel(value);
        }
        else if (this.widgetAttacher.getWidget(0) != value)
        {
            this.widgetAttacher.detachWidget();
            this.widgetAttacher = new FakePanel(value);
        }
    }

    public void open(MapWidget mapWidget, MVCObject<?> anchor){
        infoWindow.open(mapWidget, anchor);
    }

    public void close(){
        infoWindow.close();
    }

}

пятница, 22 июня 2012 г., 6:39:20 UTC+4 пользователь Joseph Lust написал:

John99

unread,
Jun 22, 2012, 3:09:23 AM6/22/12
to google-we...@googlegroups.com
some code i've took from here:

http://code.google.com/p/gwt-maps3/source/browse/trunk/src/com/googlecode/maps3/client/InfoWindow.java

пятница, 22 июня 2012 г., 11:04:14 UTC+4 пользователь John99 написал:
Reply all
Reply to author
Forward
0 new messages