GWT Bindings for GMaps Utility Library

35 views
Skip to first unread message

Bobby

unread,
Oct 19, 2009, 5:37:54 PM10/19/09
to Google API Libraries for GWT
Right now i could use GWT bindings for the Marker Manager and i'd like
to contribute this, but i think it would be a better idea to keep all
these utilities together and just create bindings for the whole gmaps-
utility-library:
http://gmaps-utility-library.googlecode.com/svn/trunk/

We would create a module, gwt-maps-utility, that inherits from the gwt-
maps module and adds support for all the utilities.

I don't think the bindings need to be in separate libraries and
separate projects. It just makes it more difficult to use. The concept
would be similar to the gdata bindings:
http://code.google.com/p/gwt-gdata/

Any thoughts?

Bobby

Bobby

unread,
Oct 19, 2009, 6:12:48 PM10/19/09
to Google API Libraries for GWT
I've created a project here:
http://code.google.com/p/gwt-maps-utility/

Bobby

Bobby

unread,
Oct 21, 2009, 4:34:03 AM10/21/09
to Google API Libraries for GWT
One minor pain so far, the JSIO implementation for the Marker class
doesn't expose a getPeer() method, which is necessary to obtain the
JavaScriptObject to pass on to the JS Utilities such as the Marker
Manager. Here's my solution:
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-utility/src/com/google/gwt/maps/utility/client/impl/MapsHelper.java

A working implementation for MarkerManager is here:
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-utility/src/com/google/gwt/maps/utility/client/markermanager/MarkerManager.java

Bobby

Bobby

unread,
Oct 21, 2009, 4:25:56 PM10/21/09
to Google API Libraries for GWT
Added a binding for Marker Clusterer:
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-utility/src/com/google/gwt/maps/utility/client/markerclusterer/MarkerClusterer.java

That's a "ridiculous" component. Just used it in a GWT POC with 2500
data points, superb!

Bobby

On Oct 21, 4:34 am, Bobby <bobbysoa...@gmail.com> wrote:
> One minor pain so far, the JSIO implementation for the Marker class
> doesn't expose a getPeer() method, which is necessary to obtain the
> JavaScriptObject to pass on to the JS Utilities such as the Marker
> Manager. Here's my solution:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-ut...
>
> A working implementation for MarkerManager is here:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-ut...

Eric Ayers

unread,
Oct 21, 2009, 6:45:46 PM10/21/09
to gwt-goo...@googlegroups.com
There's a patch up for the map icon maker up on the galgwt-reviews site.

Feel free to pull it in to your library if you don't already have such a class

http://galgwt-reviews.appspot.com/41606/show
--
Eric Z. Ayers
Google Web Toolkit, Atlanta, GA USA

Bobby

unread,
Oct 21, 2009, 7:34:12 PM10/21/09
to Google API Libraries for GWT
Nice, i'll merge it in.

By the way, since i can't load the JS libraries through the JSAPI/
AjaxLoader, i'm storing the version and script references in an enum:
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-utility/src/com/google/gwt/maps/utility/client/DefaultPackage.java

This is for those of us who don't like adding the script references
manually (me). Manually loading the script references will still work.
The script versions and locations can be changed by implementing the
following interface:
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-utility/src/com/google/gwt/maps/utility/client/GoogleMapsUtilityPackage.java

The following class takes care of dynamically loading the references
and supplying an onLoad event.
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-utility/src/com/google/gwt/maps/utility/client/GoogleMapsUtility.java

This makes loading as easy as:
GoogleMapsUtility.loadUtilityApi(new Runnable() {
public void run() {
begin();
}
},
DefaultPackage.MARKER_MANAGER,
DefaultPackage.MARKER_CLUSTERER
...etc);

Bobby

On Oct 21, 6:45 pm, Eric Ayers <zun...@google.com> wrote:
> There's a patch up for the map icon maker up on the galgwt-reviews site.
>
> Feel free to pull it in to your library if you don't already have such a class
>
> http://galgwt-reviews.appspot.com/41606/show
>
>
>
> On Wed, Oct 21, 2009 at 1:25 PM, Bobby <bobbysoa...@gmail.com> wrote:
>
> > Added a binding for Marker Clusterer:
> >http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-ut...

Bobby

unread,
Oct 21, 2009, 10:54:23 PM10/21/09
to Google API Libraries for GWT
Added bindings for ProgressBarControl:
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-utility/src/com/google/gwt/maps/utility/client/progressbarcontrol/ProgressBarControl.java

Some of the utilities require a little more planning, for example, the
TabbedMaxContent
http://gmaps-utility-library.googlecode.com/svn/trunk/tabbedmaxcontent/1.0/docs/reference.html

It extends classes from the Maps API, such as MapWidget and Marker.
The MapWidget is marked as final, Marker isn't. This means i can't
extend MapWidget. I can extend Marker, but i'm not sure if that's the
best option given it's implemented with JSIO, plus i'd like to use the
same approach on both classes.

I can add wrapper classes but that's probably too expensive,
especially with a class like Marker of which there can be hundreds of
instances at any given time.

It's not the prettiest solution, but the lighter and more efficient
option would be to expose the extension methods in TabbedMaxContent as
static methods, e.g:

public static TabbedMaxContentExtension {
static TabbedMaxContent getTabbedMaxContent(MapWidget map);
static void openMaxContentTabs(MapWidget map, LatLng latlng,
Element minNode, Element summaryNode, MaxContentTab[] tabs,
MaxContentOptions options);
static void openMaxContentTabsHtml(MapWidget map, LatLng latlng,
String minHtml, String summaryHtml, MaxContentTab[] tabs,
MaxContentOptions options)
}

Any thoughts?

Bobby

On Oct 21, 7:34 pm, Bobby <bobbysoa...@gmail.com> wrote:
> Nice, i'll merge it in.
>
> By the way, since i can't load the JS libraries through the JSAPI/
> AjaxLoader, i'm storing the version and script references in an enum:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-ut...
>
> This is for those of us who don't like adding the script references
> manually (me). Manually loading the script references will still work.
> The script versions and locations can be changed by implementing the
> following interface:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-ut...
>
> The following class takes care of dynamically loading the references
> and supplying an onLoad event.http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-ut...

Bobby

unread,
Oct 22, 2009, 1:41:27 AM10/22/09
to Google API Libraries for GWT
I think TabbedMaxContent is one to leave out. The reason is that the
GWT maps library makes it easy to build a maximized, tabbed info
window - just add a GWT tabs widget onto an info window.

The binding would yield a non-widget tab control that's less
versatile, so the advantage there is minimal. If we do add this
control, we're better off just building it by combining the InfoWindow
in gwt-maps and the GWT tabs widget.

If someone disagrees, let me know.

Bobby

On Oct 21, 10:54 pm, Bobby <bobbysoa...@gmail.com> wrote:
> Added bindings for ProgressBarControl:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-ut...
>
> Some of the utilities require a little more planning, for example, the
> TabbedMaxContenthttp://gmaps-utility-library.googlecode.com/svn/trunk/tabbedmaxconten...

Eric Ayers

unread,
Oct 22, 2009, 9:30:33 AM10/22/09
to gwt-goo...@googlegroups.com
On Wed, Oct 21, 2009 at 7:54 PM, Bobby <bobby...@gmail.com> wrote:
>
> Added bindings for ProgressBarControl:
> http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-utility/src/com/google/gwt/maps/utility/client/progressbarcontrol/ProgressBarControl.java
>
> Some of the utilities require a little more planning, for example, the
> TabbedMaxContent
> http://gmaps-utility-library.googlecode.com/svn/trunk/tabbedmaxcontent/1.0/docs/reference.html
>
> It extends classes from the Maps API, such as MapWidget and Marker.
> The MapWidget is marked as final, Marker isn't. This means i can't
> extend MapWidget. I can extend Marker, but i'm not sure if that's the
> best option given it's implemented with JSIO, plus i'd like to use the
> same approach on both classes.

MapWidget is marked final because it is very complex, and we don't
want to risk breaking derived classes inadvertently. You should use
composition if you want to add to the functionality of MapWidget.

Extending the Marker class is a good route to take. It already is an
extension of the Overlay class and won't add any extra objects at
runtime.

The Maps API pre-dates the JavaScriptObject subclassing feature
introduced in GWT 1.5. If I had it to do over, we probably would not
be using the JSIO library at all.

> I can add wrapper classes but that's probably too expensive,
> especially with a class like Marker of which there can be hundreds of
> instances at any given time.
>
> It's not the prettiest solution, but the lighter and more efficient
> option would be to expose the extension methods in TabbedMaxContent as
> static methods, e.g:
>
> public static TabbedMaxContentExtension {
>     static TabbedMaxContent getTabbedMaxContent(MapWidget map);
>     static void openMaxContentTabs(MapWidget map, LatLng latlng,
> Element minNode, Element summaryNode, MaxContentTab[] tabs,
> MaxContentOptions options);
>     static void openMaxContentTabsHtml(MapWidget map, LatLng latlng,
> String minHtml, String summaryHtml, MaxContentTab[] tabs,
> MaxContentOptions options)
> }
>
> Any thoughts?

I would agree with your next comment, that adding GWT widgets is
pretty easy and gives you a lot of flexibility.

Bobby

unread,
Oct 25, 2009, 11:40:14 PM10/25/09
to Google API Libraries for GWT
Created a binding for Labeled Marker (extends Marker):
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsutility/src/com/google/gwt/maps/utility/client/labeledmarker/LabeledMarker.java

I'm adding the samples here as i go:
http://gwt-maps-utility.appspot.com/v/HelloMapsUtility.html

Bobby

On Oct 22, 9:30 am, Eric Ayers <zun...@google.com> wrote:
> On Wed, Oct 21, 2009 at 7:54 PM, Bobby <bobbysoa...@gmail.com> wrote:
>
> > Added bindings for ProgressBarControl:
> >http://code.google.com/p/gwt-maps-utility/source/browse/trunk/maps-ut...
>
> > Some of the utilities require a little more planning, for example, the
> > TabbedMaxContent
> >http://gmaps-utility-library.googlecode.com/svn/trunk/tabbedmaxconten...

Bobby

unread,
Nov 2, 2009, 1:55:50 AM11/2/09
to Google API Libraries for GWT
Added bindings for PopupMarker:
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsutility/src/com/google/gwt/maps/utility/client/popupmarker/PopupMarker.java

Added PopupMarker samples:
http://gwt-maps-utility.appspot.com/v/HelloMapsUtility.html

Bobby

On Oct 25, 10:40 pm, Bobby <bobbysoa...@gmail.com> wrote:
> Created a binding for Labeled Marker (extends Marker):http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsuti...
> > Google Web Toolkit, Atlanta, GA USA- Hide quoted text -
>
> - Show quoted text -

Bobby

unread,
Nov 3, 2009, 2:35:50 AM11/3/09
to Google API Libraries for GWT
Added samples for MarkerManager and ProgressBar:
http://gwt-maps-utility.appspot.com/v/HelloMapsUtility.html

Bobby

On Nov 2, 1:55 am, Bobby <bobbysoa...@gmail.com> wrote:
> Added bindings for PopupMarker:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsuti...

Bobby

unread,
Nov 6, 2009, 4:11:08 AM11/6/09
to Google API Libraries for GWT

Bobby

unread,
Nov 14, 2009, 8:02:24 PM11/14/09
to Google API Libraries for GWT

Bobby

unread,
Nov 26, 2009, 1:23:48 AM11/26/09
to Google API Libraries for GWT
The first version of this library will have support for the following
utilities:
* LabeledMarker
* MapIconMaker
* MarkerClusterer
* MarkerManager
* MarkerTracker
* PopupMarker
* ProgressBarControl
* SnapToRoute

I'm leaving the remaining utlities out of the first release - some
duplicate capabilities present in gwt-maps and some just require some
more thought (might be added in a future release).
* DragZoom
* KeyDragZoom
* ExtInfoWindow
* ExtLargeMapControl
* ExtMapTypeControl
* TabbedMaxContent

I still need to write unit tests, add a binding for MarkerTracker and
port over some more of the samples. That'll be it for version 1.

Bobby

On Nov 14, 8:02 pm, Bobby <bobbysoa...@gmail.com> wrote:
> Added bindings and sample for SnapToRoute:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsuti...http://gwt-maps-utility.appspot.com/v/HelloMapsUtility.html

Bobby

unread,
Dec 2, 2009, 3:37:23 AM12/2/09
to Google API Libraries for GWT

Bobby

unread,
Dec 2, 2009, 4:21:26 AM12/2/09
to Google API Libraries for GWT
I'm going to be packaging the JS source files inside the JAR, to
remove the dependency on http://gmaps-utility-library.googlecode.com/svn/trunk/.

The JS files are still loaded dynamically and transparently, and it's
still possible to load from a custom location by implementing the
GoogleMapsUtilityPackage interface and passing to
GoogleMapsUtility.loadUtilityApi():
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsutility/src/com/google/gwt/maps/utility/client/GoogleMapsUtilityPackage.java

Bobby

On Dec 2, 3:37 am, Bobby <bobbysoa...@gmail.com> wrote:
> Added bindings and samples for Marker Tracker:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsuti...http://gwt-maps-utility.appspot.com/v/HelloMapsUtility.html

Bobby

unread,
Dec 6, 2009, 4:49:41 AM12/6/09
to Google API Libraries for GWT
I was apparently using the old repository for the JS project, the new
one contains three additional utilties which i'll be adding support
for:
ContextMenuControl - http://gmaps-utility-library-dev.googlecode.com/svn/tags/contextmenucontrol/1.0/docs/reference.html
Mapsicle - http://gmaps-utility-library-dev.googlecode.com/svn/tags/mapsicle/1.0/docs/reference.html
SnapShotControl - http://gmaps-utility-library-dev.googlecode.com/svn/tags/snapshotcontrol/1.0/docs/reference.html

The remaining utilities are all set. Unit tests were all successful
save for one which yielded the following issue:
http://code.google.com/p/gmaps-utility-library-dev/issues/detail?id=168

I personally get some satisfaction out of finding issues in the
underlying JS APIs via unit tests, when building GWT bindings, it
really underlines one of the strengths of GWT.

Anyway, i expect to have this library available before the end of the
year.

Bobby

On Dec 2, 4:21 am, Bobby <bobbysoa...@gmail.com> wrote:
> I'm going to be packaging the JS source files inside the JAR, to
> remove the dependency onhttp://gmaps-utility-library.googlecode.com/svn/trunk/.
>
> The JS files are still loaded dynamically and transparently, and it's
> still possible to load from a custom location by implementing the
> GoogleMapsUtilityPackage interface and passing to
> GoogleMapsUtility.loadUtilityApi():http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsuti...
>
> Bobby
>
> On Dec 2, 3:37 am, Bobby <bobbysoa...@gmail.com> wrote:
>
> > Added bindings and samples for Marker Tracker:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsuti...
>
> ...
>
> read more »

Bobby

unread,
Dec 9, 2009, 4:04:22 AM12/9/09
to Google API Libraries for GWT

Bobby

unread,
Dec 16, 2009, 11:00:41 PM12/16/09
to Google API Libraries for GWT

Eric Ayers

unread,
Dec 16, 2009, 11:12:05 PM12/16/09
to gwt-goo...@googlegroups.com
Congratulations!

> ...
>
> read more »

--
You are subscribed to the Google Groups "GWT-Google-Apis" group.
For more options, visit http://groups.google.com/group/gwt-google-apis?hl=en

Florian

unread,
Dec 19, 2009, 6:35:26 AM12/19/09
to Google API Libraries for GWT
Does it work with GWT 2?
I use gwt2, and soon as i try to use a class from the library i have a
"GWT Code Server Disconnected" error in development mode.

On Dec 17, 5:00 am, Bobby <bobbysoa...@gmail.com> wrote:
> Version 1.0 is available:http://code.google.com/p/gwt-maps-utility/
>
> Bobby
>
> On Dec 9, 4:04 am, Bobby <bobbysoa...@gmail.com> wrote:
>
>
>
> > Added bindings and samples for ContextMenuControl and SnapShotControl:http://code.google.com/p/gwt-maps-utility/source/browse/trunk/mapsuti...
>

> ...
>
> read more »

Bobby

unread,
Dec 19, 2009, 7:08:21 PM12/19/09
to Google API Libraries for GWT
Florian, did you add the module references for gwt-maps and gwt-maps-
utility to your module's .gwt.xml file? For example as in the
following sample:
http://code.google.com/p/gwt-maps-utility/source/browse/trunk/samples/hellomapsutility/src/com/google/gwt/maps/utility/sample/hellomapsutility/HelloMapsUtility.gwt.xml

If so, can you post the error that dev mode is reporting?

Bobby

> ...
>
> read more »

Bobby

unread,
Dec 19, 2009, 8:43:50 PM12/19/09
to Google API Libraries for GWT
I've repackaged the library to use the online JS repository for the
default package locations. The corresponding JS files are still
included with the JAR and can be used, but by default the packages
will be loaded from http://gmaps-utility-library-dev.googlecode.com/.

Bobby

Reply all
Reply to author
Forward
0 new messages