スカイ(星座)モードにする

説明

スカイ(星座)モードにするには「グーグルアースオブジェクト.getOptions().setMapType(グーグルアースオブジェクト.MAP_TYPE_SKY)」とします。通常のグーグルアースにしたい場合はsetMapType(グーグルアースオブジェクト.MAP_TYPE_EARTH)と指定します。


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 initCallback(ge){
ge.getWindow().setVisibility(true);
ge.getOptions().setMapType(ge.MAP_TYPE_SKY);
}
);
}
</script>
</body>
</html>