プラグインのバージョンを取得する

説明

プラグインのバージョンを取得するには「グーグルアースオブジェクト.getPluginVersion()」とします。バージョンは文字列で返されます(例:5.2.1.1588)。


Google Maps APIプログラミング入門 Google Maps API プログラミング入門。Google Maps API Expertである勝又雅史氏が最新のAPI ver3やGoogle Maps for Flashなどについて解説しています。
アマゾンで購入する

サンプルコード [実行]

<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Google Earth API ver 1 Sample/グーグルアースAPIサンプル/Google Earth API样品</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script src="http://www.google.com/jsapi?key=ABQIAAAAasAJryKxWJnBFVJa487d9hTHGAxTVT7IRADYa-JdYz7xQ8IQZBSthgDZdggYpQHsmm6WYtHstQFfLA"></script>
</head>
<body>
<div id="gEarth" style="width:800px;height:500px;"></div>
<script type="text/javascript">
google.load("earth", "1");
window.onload = function(){
google.earth.createInstance("gEarth",function(ge){
var ver = ge.getPluginVersion();
alert(ver);
});
}
</script>
</body>
</html>