GWT Implementation of GMaps Utility Library's Marker Manager

UPDATE: Many of the features in the Future Implementations section below are in GWT Overlay Manager for Google Maps.

Since the Google Maps API will soon be depreciating their own implementation of MarkerManager in favor of the implementation in the GMaps Utility Library project, I thought I'd jump the gun and implement it in GWT, since that's the only way I use the Google Maps API any more.

In this zip file, CoreMaps.zip, you'll find the following Java files.

  • OverlayManager.java - The interface for all of the overlay, or marker, managers
  • OverlayManagerOptions.java - The options class, basically a direct port of GMarkerManagerOptions
  • MarkerManagerImpl.java - The direct port of the MarkerManager javascript implementation from the GMaps Utility Library, and currently the only implementation of the OverlayManager interface

To add this to your GWT project, just unzip the file above into your project's Java source directory.  Then add the following tag to your application's *.gwt.xml file.

<inherits name="com.ebessette.maps.core.CoreMaps"></inherits>

Note, the zip file already includes the latest code, as of the time of this post, for GWT Google Maps from the GWT Google API subversion repository.  Also, this code is written in Java 5.0, so it needs GWT 1.5RC1 or above to work.

Future Implementations

I'm going to start working on an implementation that will allow developers to manage any kind of overlay, not just markers.  I'm going to try to do it so any assumptions regarding what it means for an overlay to be in the view port (like part of a polygon) can be overridden if the developer chooses to do so.

Another feature I'd like to add, is an Event Handler setup that will trigger calls to get overlays when the view port changes.  That way, not only will the OverlayManager control when overlays should be displayed, but also when they should be retrieved.  There are a lot of problems to overcome to make this efficient, but I believe it's possible and will help create the fastest running Google Maps applications out there.

 

AttachmentSize
CoreMaps.zip278.73 KB