views:

82

answers:

3

Does the Google Maps Javascript API have a property/method that returns its exact version number?

I need this info for debugging purposes.

A: 

I suppose the G_API_VERSION could do :

This constant specifies the version of the API currently being served to your page.

I've just tested on two sites, and it contained things like "193c" and "140g".

Pascal MARTIN
not exactly what I want... it should report something like v2.3.1 (like the version you request in the script tag). Do you know if i can deduct the "official" version from the G_API_VERSION key?
Franz
A: 

When you include Google Maps API you can choose version of it. Example:

<script type="text/javascript" src="http://www.google.com/jsapi?key=LONG_KEY_HERE"&gt;&lt;/script&gt;
<script type="text/javascript">
/*<![CDATA[*/
    google.load('maps', '2');
/*]]>*/
</script> 

Here we want to use version 2 of Google Maps API.

Sergey Kuznetsov
I need a more detailed version number, like major.minor.build...
Franz
google.load('maps', '2.1'), for example :) or any other versions
Sergey Kuznetsov
A: 

In the Maps API v2, G_API_VERSION is what you want. For example, 193c means its loading v2.193c, 140g means 2.140g.

Changelog is here: http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIChangelog

Ossama