var initPosPanoID, streetView; function initialize() { // Set StreetView provider. var streetViewOptions = { zoom: 0, panoProvider: getCustomPanorama, pano : "zastavenie27" }; // Create a StreetView object. var streetViewDiv = document.getElementById('streetview_canvas'); streetView = new google.maps.StreetViewPanorama(streetViewDiv, streetViewOptions); // Add links when it happens "links_change" event. google.maps.event.addListener(streetView, "links_changed", createCustomLink); } function getCustomPanoramaTileUrl(panoID, zoom, tileX, tileY) { // Return a pano image given the panoID. return "web_data/virtualna-prehliadka/park-svaty-anton/" + panoID + '/' + tileX + '-' +tileY + '.jpg'; } function getCustomPanorama(panoID) { var streetViewPanoramaData = { links: [], copyright: 'Daniel Kubinský', tiles: { tileSize: new google.maps.Size(256, 256), worldSize: new google.maps.Size(2048, 1024), centerHeading: 250, getTileUrl: getCustomPanoramaTileUrl } }; switch(panoID) { case "zastavenie27": streetViewPanoramaData["location"] = { pano: 'zastavenie27', description: "Zastavenie27", latLng: new google.maps.LatLng(0, 0) }; return streetViewPanoramaData; } } function createCustomLink() { /* * add links */ var links = streetView.getLinks(); var panoID = streetView.getPano(); switch(panoID) { } } google.maps.event.addDomListener(window, 'load', initialize);