fbuchinger
fbuchinger

Reputation: 4514

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 info for debugging purposes.

Upvotes: 10

Views: 10769

Answers (4)

Serzhas
Serzhas

Reputation: 914

To acccess exact version of Google Maps API one can check google.maps.version

Upvotes: 20

Ossama
Ossama

Reputation: 2417

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

Upvotes: 0

Sergey Kuznetsov
Sergey Kuznetsov

Reputation: 8721

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"></script>
<script type="text/javascript">
/*<![CDATA[*/
    google.load('maps', '2');
/*]]>*/
</script> 

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

Upvotes: 2

Pascal MARTIN
Pascal MARTIN

Reputation: 401052

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".

Upvotes: 0

Related Questions