例−26:Google Maps + Google Earth
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>例−26:Google Maps + Google Earth</title>
<script src="http://maps.google.co.jp/maps?file=api&v=2&key=[MAPS_API_KEY]"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load(){
if (GBrowserIsCompatible()) {
// 地図を作成
var point = new GLatLng(35.658587, 139.745425);
var map = new GMap2(document.getElementById("map"));
map.setCenter(point, 17, G_SATELLITE_3D_MAP );
var marker = new GMarker(new GLatLng(35.6606,139.7455));
//マーカーをクリックしたら、吹き出しの中に写真を表示する
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml("<h3 style='width:200px;'>Googleマップ + Google Earth</h3>");
});
map.addOverlay(marker);
GEvent.trigger(marker,"click");
}
}
GEvent.addDomListener(window, "load", load);
GEvent.addDomListener(window, "unload", GUnload);
//]]>
</script>
</head>
<body >
<h1>例−26:Google Maps + Google Earth</h1>
<div id="map" style="width:600px;height:600px;">
</body>
</html>


