Version 2 cleans up much of the API, improving performance and stability in fundamental ways, based on feedback from 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 one, which should improve the user experience on your website.
- Two additional satellite zoom levels. Increased imagery resolution and coverage in the U.S., Canada, the 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. TheGMap2
The interface has been redesigned to allow API users to extend it. We now have documented ways to create custom map controls, 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 withGLog.write()
. - Last but not least, a
GLatLng
The class that is distinct from GPoint. You no longer need to reverse your latitude and longitude to construct a geographic point!
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. 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 you all 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.
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 with an updated interface and new method names. The old map class will continue to exist in Version 2 of the API and includes 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 that things may be slightly more complex in practice. 😉 In particular, we did not preserve many undocumented functions, so many sites will need to update their scripts to accommodate this change.
Rollout Timeline
We ask that you try using the new API over the next couple of weeks on your development and staging servers and report any issues or bugs you find to the discussion group, so we can assess how easy the transition will be for most sites. Version 1 and Version 2 will coexist for at least a month, regardless of the number of bugs reported. We may also 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.