ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
ggv_pano_basic.php ( No.0 )
日時: 2010/11/18 15:39
名前: lightbox



<?
header( "pragma: no-cache" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );
header( "Cache-control: no-cache" );

$api_key
 = 'ABQIAAAADuryzsZi1CenwhafsPEvzBRS10rmJJPhM3vlpPkrWCHuNTDImRTYfD_FN1NxrjVEOgXa8q0JiFN0CQ';

if ( $_GET['w'] == '' ) {
	$_GET['w'] = 600;
}
if ( $_GET['h'] == '' ) {
	$_GET['h'] = 400;
}

?>
<!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></title>

<script
	src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=<?= $api_key ?>"
	type="text/javascript"
></script>

<script type="text/javascript">
var myPano;
var mylat,mylng;

function initialize() {

	myPano = new GStreetviewPanorama(document.getElementById("pano"));
	var fenwayPark = new GLatLng(<?=$_GET['a']?>,<?=$_GET['b']?>);
	myPOV = {yaw:<?=$_GET['c']?>,pitch:<?=$_GET['d']?>,zoom:0};
	myPano.setLocationAndPOV(fenwayPark, myPOV);
	GEvent.addListener(myPano, "error", handleNoFlash);
	GEvent.addListener(myPano, "initialized", getTargetLatLng);

}

function handleNoFlash(errorCode) {

	if (errorCode == 603) {
		alert("Error: Flash doesn't appear to be supported by your browser");
		return;
	}
}

function getTargetLatLng(myLocation) {
	mylat = myLocation.latlng.lat();
	mylng = myLocation.latlng.lng();
	try {
		parent.document.getElementById("lat").value = mylat;
		parent.document.getElementById("lng").value = mylng;
		parent.iframePano = myPano;
	}
	catch(e){};
}

</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div name="pano" id="pano" style='width:<?= $_GET['w'] ?>px;height:<?= $_GET['h'] ?>px;'></div>
</body>
</html>