ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
Google MAP 経由の Panoramio ギャラリーの表示
日時: 2010/11/22 19:34
名前: lightbox



  PHP
拡張子:
<?
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'] = 800;
}
if ( $_GET['h'] == '' ) {
	$_GET['h'] = 600;
}

?>
<!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>Panoramio : <?= $_GET['id'] ?></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;
function initialize() {

	var panoOpts = { 
		features: { streetView: false, userPhotos: true },
		userPhotoOptions: { photoRepositories: [ 'panoramio'] } 
	}; 

	myPano = new GStreetviewPanorama(document.getElementById("pano"), panoOpts);
	var fenway = { repository: "panoramio", id: "<?= $_GET['id'] ?>" }; 
	GEvent.addListener(myPano, "error", handleNoFlash);
	myPano.setUserPhoto(fenway);
}

function handleNoFlash(errorCode) {

	if (errorCode == 603) {
		alert("Error: Flash doesn't appear to be supported by your browser");
		return;
	}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div name="pano" id="pano" style='width:<?= $_GET['w'] ?>px;height:<?= $_GET['h'] ?>px;'></div>
</body>
</html>
  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></title>

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

<script type="text/javascript">
var params = (location.search + "&&&&&&&&&").replace("?","");
var param = params.split("&");
if ( param[1] == '' ) {
	param[1] = "800px";
}
else {
	param[1] += "px";
}
if ( param[2] == '' ) {
	param[2] = "600px";
}
else {
	param[2] += "px";
}

var myPano;
function initialize() {

	var panoOpts = { 
		features: { streetView: false, userPhotos: true },
		userPhotoOptions: { photoRepositories: [ 'panoramio'] } 
	}; 

	myPano = new GStreetviewPanorama(document.getElementById("pano"), panoOpts);
	var fenway = { repository: "panoramio", id: param[0] }; 
	GEvent.addListener(myPano, "error", handleNoFlash);
	myPano.setUserPhoto(fenway);
}

function handleNoFlash(errorCode) {

	if (errorCode == 603) {
		alert("Error: Flash doesn't appear to be supported by your browser");
		return;
	}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div name="pano" id="pano"></div>
<script type="text/javascript">
document.getElementById("pano").style.width = param[1];
document.getElementById("pano").style.height = param[2];
</script>
</body>
</html>
メンテナンス


日時: 2010/11/22 19:34
名前: lightbox