[英]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? Google Maps Javascript API是否具有返回其确切版本号的属性/方法?
I need this info for debugging purposes. 我需要这些信息用于调试目的。
要获得Google Maps API的确切版本,可以查看google.maps.version
When you include Google Maps API you can choose version of it. 当您添加Google Maps API时,您可以选择它的版本。 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. 在这里,我们要使用Google Maps API的第2版。
I suppose the G_API_VERSION
could do : 我想
G_API_VERSION
可以这样做:
This constant specifies the version of the API currently being served to your page.
此常量指定当前为您的页面提供的API的版本。
I've just tested on two sites, and it contained things like "193c"
and "140g"
. 我刚刚在两个网站上进行了测试,它包含了诸如
"193c"
和"140g"
。
In the Maps API v2, G_API_VERSION is what you want. 在Maps API v2中,您可以使用G_API_VERSION。 For example, 193c means its loading v2.193c, 140g means 2.140g.
例如,193c表示其装载v2.193c,140g表示2.140g。
Changelog is here: http://code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIChangelog 更改日志位于: http : //code.google.com/p/gmaps-api-issues/wiki/JavascriptMapsAPIChangelog
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.