Groups Images Directory Web
Recently Visited Groups | Help | Sign in
Google Groups Home
Group info
Members: 41708
Language: English
Group categories:
Science and Technology > Earth Sciences
Computers > Internet
More group info »
Javascript Maps API Versioning    
The Maps API evolves, weekly. New features are introduced all the time (thanks!), but new features also means bugs (oh dear). 

So in an effort to allow the developer some control over this, the API uses a versioning system whereby you can specify which version you require, ranging from the latest and (hopefully) greatest, to a old but stable version, or even a specific version (one you know works well for you) 

The version is specified on the script tag, with the v parameter:
 <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&amp;sensor=false" type="text/javascript"></script> 

but the same version string can be used when loading the API via the common loader:
 google.load("maps", "2.x", {"other_params":"sensor=false"});


There are 4 main variations on this you can choose to use, 

  • v=2 This is the version the vast majority of mashups will use, its basically saying 'give me the latest good version', you might not get the very latest features, but if this version does everything you need, use it!

  • v=2.s The stable version, this is not as regularly updated as 2 so you don't get many of the cool features. But only versions that have been battle tested in the wild will be made 's', so use this if you want to make sure the application will work in the long term.

  • v=2.x The 'x' or experimental version, is the upcoming new version - this lets you try out the latest features. Normally you would only use this version in development and/or when you are actively monitoring changes to the API. This lets you check your site will work when the API moves forward. 

  • or v=2.233d Here you are specifically requesting a certain version of the API. This is great when you want to use a feature available in the 2.x version, but don't want the unexpected hassle of something breaking when a new 2.x version is released, or know that something is broken for you in the current 2 (or even 2.s). Note however this should not be left in long term, within a few weeks you should check if the normal v=2 has fixed the issue, or incorporated the feature you want. Old API versions aren't maintained forever, so you don't want the issue that your version disappears when you least expect it. 



You can find what version you actually have loaded:

GLog.write(G_API_VERSION)

... so if you are happy with the current version and want to continue to use that version for the short-term then just plug this version into the URL, don't forget to set a reminder to check later if the API has caught up (or fixed the issue affecting you). 


New releases into the 2.x trunk are announced as they happen into the Issues wiki here, this also notes which actual versions the various aliases represent, subscribe to the RSS feed here  (or a Pipe). You can also get hints on this unoffical changelog, with its own RSS feed

There is also a new announcement only group for API changes: http://groups.google.com/group/google-maps-api-notify

Version: 
Latest 3 messages about this page (19 total) - view full discussion
2 Apr 2009 by Tom NY
"If you were to use, say, search features, the data that might
or might not be returned would be changing on a daily basis, and
certainly without QA approval."

That isn't the same thing. Getting different data is not unusual.
Anyone who uses a database does that without QA approval. But if, for
2 Apr 2009 by Tom NY
And please, I am not complaining. Pamela has asked for advice and
help in making their service even more useful. Should we ignore her
and say it's fine as it is? I'm not talking about reworking the API.
I'm not even asking for an enhancement to the API!!! All I'm
suggesting is that the documentation be cleaned up a little and that
2 Apr 2009 by Rossko
Not suggesting that at all, I was pointing out that QA procedures
suited for static applications will find it hard to keep tabs on any
internet based services, it's a moving target. Doing things like
pegging an API version is certainly the best you can do, but its not
the whole story. Can't suggest any solutions for that!
16 more messages »
Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google