Google Maps Streetview - How to get a Panorama ID

I want to use a custom panorama, but for this I need a panorama identifier. Can someone explain to me how to get the pano id from the following link:

https://www.google.nl/maps/@52.239981,6.851849,3a,90y,324.71h,64.65t/data=!3m5!1e1!3m3!1sFEpIJhSgOzoAAAQJOQCL3w!2e0!3e11

Thanks!

+6
source share
7 answers

Got it!

https://www.google.nl/maps/@52.239981,6.851849,3a,90y,324.71h,64.65t/data=!3m5!1e1!3m3!1sFEpIJhSgOzoAAAQJOQCL3w!2e0!3e11

After a! 1s and before! 2e is a panorama identifier, here it is:

FEpIJhSgOzoAAAQJOQCL3w

+5
source

Google has changed the format for pano identifiers with their updates in August / September. Similarly before the pano identifier can be found between characters! 1s and! 2e. So, in the example posted by Jason, the pano id will be (urldecoded):

F:-gVtvWrACv2k/Vnh0Vg8Z8YI/AAAAAAABLWA/a-AT4Wb8MD8

To make it work for us, we had to add F: in front of it. There is also a known bug that requires the addition of an undocumented flag to use newer panels (see https://code.google.com/p/gmaps-api-issues/issues/detail?id=7452#c51 ):

 google.maps.streetViewViewer = 'photosphere'; 
+9
source

As Justin MacLeod mentioned, but here's what I did for sure.

You need to set up an ID number. You can still find the identification number between the characters! 1s and! 2e, but you need to update the url for it to work.

 Add F: to the start of your ID Change %2F in the ID to / 

Example of my identifier Do:

 -3_7tAKLhLLU%2FV0nuKmxj7xI%2FAAAAAAAAdE8%2FHZYhfYoBGqAsQw-63snzF9OkIy7YT051ACLIB 

After:

 F:-3_7tAKLhLLU/V0nuKmxj7xI/AAAAAAAAdE8/HZYhfYoBGqAsQw-63snzF9OkIy7YT051ACLIB 
+2
source
  • Find the panel on Google Maps.
  • Open Developer Toolbar
  • Copy / Paste / Perform the following. The result should be the pano identifier.

 "F:".concat(window.location.href.split("!1s")[1].split("!2e")[0]).replace('%2F','/') 

Thanks @Rgrauphics

+2
source

To get the pano identifier (pano), I developed a small HTML page where you can get some of its parameters (zoom / Pov, pitch and heading) and get the HTTP URL of the Street View Image URL.

Remember to replace YOUR_API_KEY with your own API key (obviously)

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 the API key, open the html file in a browser, click the "do it" button.

Additional links can be found on Google: https://developers.google.com/maps/documentation/javascript/streetview#StreetViewPanoramas

+1
source

When you are on Google maps looking at your inner panorama. Just click on the flag to report a panorama. You will then see a parameter in the URL called "panoid" with the pano id. You can just copy it there. As far as I know, it is no longer in the URL on the page of the panoramic page.

0
source

Source: https://habr.com/ru/post/986119/


All Articles