I want to use custom panorama position, but I need a panorama id for it. Can someone explain me how to get the panorama id from the next link:
Thank you!
I want to use custom panorama position, but I need a panorama id for it. Can someone explain me how to get the panorama id from the next link:
Thank you!
Got it!
After the !1s and before the !2e is the Panorama ID, so here is it:
FEpIJhSgOzoAAAQJOQCL3w
Google changed the format of the pano IDs with their updates in Aug/Sept. Similar to before the pano ID can be found between the !1s and !2e. So in the example posted by Jason the pano ID would be (urldecoded):
F:-gVtvWrACv2k/Vnh0Vg8Z8YI/AAAAAAABLWA/a-AT4Wb8MD8
In order to get it to work for us we had to prepend the F: in front of it. There is also a known bug which requires the addition of an undocumented flag to use newer panos (see https://code.google.com/p/gmaps-api-issues/issues/detail?id=7452#c51):
google.maps.streetViewViewer = 'photosphere';
Got it!
After the !1s and before the !2e is the Panorama ID, so here is it:
FEpIJhSgOzoAAAQJOQCL3w
This does not work for photos added to Google Maps after the Sept 3rd 2015 update.
"F:".concat(window.location.href.split("!1s")[1].split("!2e")[0]).replace('%2F','/')
Thanks @Rgrauphics
"F:".concat(window.location.href.split("!1s")[1].split("!2e")[0]).replace(/%2F/g,'/')
–
Walburga As Justin MacLeod mentioned, but here is what I did exactly.
You need to adjust the ID number. You can still find the ID number between the !1s and !2e but you need to update your url for it to work.
Add F: to the start of your ID
Change %2F in the ID to /
My ID example Before:
-3_7tAKLhLLU%2FV0nuKmxj7xI%2FAAAAAAAAdE8%2FHZYhfYoBGqAsQw-63snzF9OkIy7YT051ACLIB
After:
F:-3_7tAKLhLLU/V0nuKmxj7xI/AAAAAAAAdE8/HZYhfYoBGqAsQw-63snzF9OkIy7YT051ACLIB
In order to get a panorama ID (pano), I have developed a little HTML page whith which you can get some of its parameters (zoom/Pov, pitch and heading) and get the Street View Image request HTTP URL.
Don't forget to replace the YOUR_API_KEY with your own API key (obvious)
Have fun with google maps!!
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
html,
body {
height: 95%;
margin: 0;
padding: 0;
}
#map,
#pano {
float: left;
height: 95%;
width: 45%;
}
</style>
</head>
<body>
<div id="tray">
<button id="doer" onclick="doThings()">do it</button>
<span id="resulting"></span>
</div>
<div id="map"></div>
<div id="pano"></div>
<script>
var panorama, map;
var APIkey= "YOUR_API_KEY"
function initialize() {
var fenway = {
lat: 42.345573,
lng: -71.098326
};
var agbar = new google.maps.LatLng(41.4035482, 2.1894355);
map = new google.maps.Map(document.getElementById('map'), {
center: agbar,
zoom: 14
});
panorama = new google.maps.StreetViewPanorama(
document.getElementById('pano'), {
position: agbar,
pov: {
heading: 34,
pitch: 10
}
});
map.setStreetView(panorama);
}
function doThings() {
console.log("doing things");
document.getElementById("resulting").innerHTML = "https://maps.googleapis.com/maps/api/streetview?size=640x640" +"&pano=" + panorama.getPano() + "&heading=" + panorama.getPov().heading + "&pitch=" + panorama.getPov().pitch + "&fov="+ (180/ (Math.pow(2, panorama.getZoom()?panorama.getZoom():1)))+ "&key=" + APIkey;
//use the next line to open in a new tab the resulting image at max size (640x640)
window.open("https://maps.googleapis.com/maps/api/streetview?size=640x640" + "&pano=" + panorama.getPano() + "&heading=" + panorama.getPov().heading + "&pitch=" + panorama.getPov().pitch + "&fov="+ (180/ (Math.pow(2, panorama.getZoom())))+ "&key=" +APIkey)
}
</script>
<script async defer src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initialize">
</script>
</body>
</html>
Instructions: create an html file, copy the code , replace API key, open html file in browser, push the "do it" button.
More references can be found at Google's: https://developers.google.com/maps/documentation/javascript/streetview#StreetViewPanoramas
When you're on google maps, looking at your interior panorama. Just click on the flag, to report the panorama. Then you'll see a parameter in the URL called 'panoid' with the panorama ID in it. You can just copy it there. It's not anywhere in the URL on the panorama page view itself anymore as far as I can see.
© 2022 - 2024 — McMap. All rights reserved.