Google Maps API Version 2

Monday, April 03, 2006 at 8:03:00 AM

Maps API Version 2 is officially launching! We're starting the beta-test of the new version that many of you have already been playing with these past few weeks.

Version 2 Features

Version 2 cleans up much of the API and improves performance and stability in fundamental ways based on the feedback of many API sites. It also includes a number of frequently-requested features, including:

  • Much smaller JavaScript download. The new Maps API JavaScript file is about half the size of the old JavaScript file, which should improve user experience on your web site.
  • Two additional satellite zoom levels. Increased imagery resolution and coverage in the U.S., Canada, U.K., Japan, Europe, and almost every major city in the world.
  • Overview map. Our new GOverviewMapControl control displays an attractive and collapsible map in the corner of the screen.
  • Extensibility and a new GMap2 class. The GMap2 interface has been redesigned to allow API users to extend it. We now have documented ways of creating custom map controls, custom overlays, and even custom map types.
  • Fewer memory leaks. The API now includes a GUnload method that you can call in the unload event of your page to destroy most circular references, including those formed implicitly during event registration. On Google Maps, this has virtually eliminated memory leaks in IE.
  • Debugging log. A simple, floating debug window used internally by the Google Maps engineering team allows you to print debug information easily without blocking program execution or interfering with the UI. Just replace your alert() calls with GLog.write().
  • Last but not least, a GLatLng class that is distinct from GPoint. You no longer need to reverse your latitude and longitude to construct a geographic point!

Check out the Version 2 documentation for a detailed usage guide.

Friendlier Terms

In conjunction with this launch, we've updated the terms and conditions for the Maps API. In particular, we've clarified and updated the two parts of our terms that have troubled developers the most:

  • No page view limits. Your site can get as many page views as you can muster. If, however, your site gets more than 500,000 page views per day, we ask that you talk to us before you launch so that we can prepare in advance to handle your traffic.
  • 90-day notice before any advertising-related change. The Maps API does not include advertising. If we ever decide to change this policy, we will give all developers at least 90 days' notice via this blog.

We hope these changes will give all of you more confidence in using the Maps API in your larger-scale commercial projects. The changes to the terms and conditions are described on our API Signup page. If you would like to see the differences between the old and new version of the Terms of Use, we've highlighted them in red on this page.

Upgrading from Version 1 to Version 2

Version 2 of the Maps API is designed to be 99% backwards-compatible with the previous version of the API. To accomplish this Version 2 introduces a new map class, GMap2, that contains an updated interface with new method names. The old map class, GMap, will continue to exist in Version 2 of the API and contains the same documented interface as Version 1 of the API.

Given this design, you should theoretically be able to update your Maps API <script> URL to refer to "v=2" instead of "v=1," and your site will just work. Remember, though, that we're engineers, not magicians, so things may be slightly more complex in practice. ;-) In particular, we did not preserve many of the undocumented functions - so many sites will have to update their scripts to accommodate this change.

For more information, check out the detailed upgrade guide in the Maps API documentation.

Rollout Timeline

We ask that you try using the new API in the next couple weeks on your development/staging servers and report the issues and bugs you find to the discussion group so we can assess how easy transition will be for most sites. Version 1 and Version 2 will coexist for at least a month no matter how few bugs are reported, and we may preserve Version 1 of the API for longer if people report many or complex transition problems. At that time, Version 2 will become the "default," and all sites will automatically start using it.

Updated: Fixed link, added byline