Google Street View を試してみた
2008 年 8 月 5 日 – 7:09 PMGoogle Street View が利用できるようになったので、ちょっと試してみた。
http://www.uzula.net/googlemap.html
これって、矢印で方向の移動もできるんだね。
これがあれば、迷うことがなさそう。しかし、プライバシーが・・・
知り合いの家をチェックしたら、車のナンバーがバッチリ映っていたし、なかなか笑えない。
上記の南行徳駅も、ぐるっと回すと、パチンコ店に並んでいる様子が・・・
知り合いなら、一発でバレそうです。
うちは田舎で未対応だけど、そのうちに対応されそうですね。怖いなぁ。
で、ソースです。
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xmlns:v=”urn:schemas-microsoft-com:vml”>
<head>
<meta http-equiv=”content-type” content=”text/html; charset=utf-8″/>
<title>Google Map で ストリートビュー</title>
<script src=”http://maps.google.com/maps?file=api&v=2&key=(あなたのAPIキー)”
type=”text/javascript”></script>
<script type=”text/javascript”>
function initialize() {
if (GBrowserIsCompatible()) {
var myPano = new GStreetviewPanorama(document.getElementById(”pano”));
GEvent.addListener(myPano, “error”, handleNoFlash);
var map = new GMap2(document.getElementById(”map_canvas”));
var lon = 139.902091 ; // ←経度の座標
var lat = 35.672349 ; // ←緯度の座標
map.setCenter(new GLatLng(lat,lon), 18);
svOverlay = new GStreetviewOverlay();
map.addOverlay(svOverlay);
GEvent.addListener(map,”click”, function(overlay,latlng) {
myPano.setLocationAndPOV(latlng);
});
//コントロール
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GScaleControl());
}
}
function handleNoFlash(errorCode) {
if (errorCode == FLASH_UNAVAILABLE) {
alert(”Error: Flash doesn’t appear to be supported by your browser”);
return;
}
}
</script>
</head>
<body onload=”initialize()” onunload=”GUnload()”>
<div id=”map_canvas” style=”width: 640px; height: 320px”></div>
<div id=”pano” style=”width: 640px; height: 320px”></div>
</body>
</html>
