Search code examples
gpsgoogle-street-view

GPS coordinates to display google street view panorama


I looked at the documentation and many other questions but I couldn't find something similar to what I am looking for. I want a query url where I give in a gps coordinate and it displays the google street view panorama, or some kind of call that when I give it a GPS coordinate it gives me the "Panoid".

I dont have the panoid, or am I trying to extract it from a URL, I want to create a call that return the panoid.


Solution

  • I found a way that I actually wasnt looking for since Im writing my program in C++. But it seems I will do it in Javascript, and pass it to my C++ program.

    In the Street View Api Documentation there is this example: https://developers.google.com/maps/documentation/javascript/examples/streetview-service

    In this example there are a few lines that are important to answering this question:

            var markerPanoID = data.location.pano;
            // Set the Pano to use the passed panoID.
            panorama.setPano(markerPanoID);
    

    I could just grab the data.location.pano value from there, then use it as however I may like. I hope this is not a final answer, I really wish if there is another way where I dont have to create a webservice.