How can I access the version number of the Google Maps API in Javascript?

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

I need this information for debugging purposes.

+6
javascript google-maps
source share
4 answers

To get the exact version of the Google Maps API, you can check google.maps.version

+15
source share

When you enable the Google Maps API, you can select its version. Example:

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

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

+1
source share

I believe that G_API_VERSION could do:

This constant defines the version of the API that is currently p.

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

0
source share

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

List of changes here: http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIChangelog

0
source share

All Articles