(对不起我的英语)我有一个问题,,,我正在尝试创建一个网络,用户在其中单击一个多边形并将用户移动到另一个带有谷歌街景全景的页面(我有)。但我还需要一个代码,在单击全景图中的关闭按钮后将用户从“全景页面”移回“多边形页面”。我尝试使用与以前相同的代码将用户移动到“全景页面”,但它不起作用(它只是关闭全景,但不会移回“多边形页面”)。该行:
google.maps.event.addListener(panorama, "closeclick", function(event) { window.location = "index.html"; })
是将用户移回“多边形页面”(index.html)的代码。这是整个代码:
function initialize() {
var panoOptions = {
pano: 'Kuchyn',
enableCloseButton: true,
pov: {
heading: 0,
pitch: 0,
zoom: 0
},
panoProvider: getCustomPanorama,
visible: true};
var panorama = new google.maps.StreetViewPanorama(
document.getElementById('map-canvas'), panoOptions);
function getCustomPanoramaTileUrl(pano, zoom, tileX, tileY) {
return 'images/Untitled.jpg';}
function getCustomPanorama(pano, zoom, tileX, tiley) {
if (pano == 'Kuchyn') {
return {
location:
{pano: 'Kuchyn',
description: 'Kromeriz - Kuchyn'},
links: [],
copyright: 'Oznog (c) 2013',
Heading: 180,
tiles:
{tileSize: new google.maps.Size(4096, 2048),
worldSize: new google.maps.Size(4096, 2048),
centerHeading: 180,
verticalFOV: 90,
getTileUrl: getCustomPanoramaTileUrl}
};
}
}
}
google.maps.event.addDomListener(window, 'load', initialize);
google.maps.event.addListener(panorama, "closeclick", function(event) { window.location = "index.html"; })
请帮帮我,简。