Moving back and forth in the street view API

I am integrating the Google Street View API in Unity for a VR project and I would like to know if the next longitude and latitude can be found if we are moving down the street.

If you are using Street View in Google maps, you can click on the arrows to move forward or backward on the street.

When you click on the arrow, you basically move to a new longitude and latitude.

I wanted to know if it is possible to add a similar action using the street view API.

Here is some of the code I'm using to load the Street View API:

string url = "http://maps.googleapis.com/maps/api/streetview?"
            + "size=" + width + "x" + height
            + "&location=" + latitude + "," + longitude
            + "&heading=" + (heading + sideHeading) % 360.0 + "&pitch=" + (pitch + sidePitch) % 360.0  
            + "&fov=90.0&sensor=false";

        if (key != "")
            url += "&key=" + key;

        WWW www = new WWW(url);
        yield return www;
        if (!string.IsNullOrEmpty(www.error))
            Debug.Log("Panorama " + name + ": " + www.error);
        else
            print("Panorama " + name + " loaded url " + url);

        renderer.material.mainTexture = www.texture;

      

So when you press the UP arrow, you can move around the screen.

+3


source to share





All Articles