Blog/Maps/

New Google Maps API Released

The Google Maps API just revved to version 2.0 on April 3, 2006. They published an Upgrade Guide, and you should really take note of it. Despite their claims that v2 is "designed to be 99% backwards compatible", I've found the changes to be pretty intrusive. Danger, Will Robinson...

As I'm walking through my Pragmatic book on the API, I'm amazed at how much of the code I'm having to touch. Here is the short list of what has changed, and I'm not even half-way through the book yet:

  • change url from "v=1" to "v=2"
  • change GMap to GMap2 (although GMap is still supported, most of the new functionality requires a GMap2)
  • change map.centerAndZoom() to map.setCenter()
  • change GPoint to GLatLng and reverse the order of the coordinates (in v1, they were Long/Lat). GPoint is still around, but it is only used for pixel coordinates now.
  • flip zoom levels from [0 (street level) - 15 (world)] to [0 (world) - 17 (street level)]. This change allows Google to add additional zoom levels in the future.
  • change MapTypes from [G_MAP_TYPE, G_SATELLITE_TYPE, G_HYBRID_TYPE] to [G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP]

Don't get me wrong -- there are plenty of plusses to the upgrade as well. They fixed the Safari bug in map.openInfoWindowHtml() that made the display all but unusable without a workaround. They added several new zoom levels, with the promise of adding more in the future. They added some new map controls. They claimed that they reduced the size of the API download by half, promising good things for improved performance. They added GUnload() that should eliminate memory leaks in IE (does anyone really use that legacy browser anymore?). And most interestingly, they finally added the ability to overlay your own imagery on the map.

Nice additions overall, but the two pages of syntax changes is giving me heartburn. In the upgrade guide, they say, "We did not preserve many of the undocumented functions... We expect that this will be the biggest source of frustration for sites upgrading to this new version of the API." Hell, I wasn't using any of the undocumented features. Maybe they're saying that to make me feel better -- "Dude, it could be worse. Way worse..."

Posted on Wed, 12 Apr 2006 00:46 by default (1604 day(s) old)

September 2010
Sun Mon Tue Wed Thu Fri Sat 
<  Aug | Sep |  Oct  >
   1234
567891011
12131415161718
19202122232425
2627282930  
       
About:

E-mail: Scott Davis

Categories:
Syndication:

XML RSS ATOM

Powered by blojsom