Search code examples
javascriptgoogle-mapsgoogle-maps-api-3google-street-view

Prevent Google StreetView Javascript API returning custom panoramas


I'm building a tool that uses the javascript StreetView AND the StreetView Image API to return images that I can composite and share. I need the interactive panoramas that Google return from its API to match the static images I get from the Image API.

What I've found is that if the panoramas are created by Google and NOT the custom user panoramas that are sometimes returned, then everything is just fine.

Unfortunately, I cannot find a property that prevents Google from returning these custom user panoramas. It is usually when the user drags the Pegman in the standard map and then drops it that I get one of these custom panoramas.

Has anyone had to do this before?


Solution

  • Adding &source=outdoor to the static image url should do the job. You can also use the Street View Image Metadata part of the static street view image api to get the nearest panorama using the same method by parsing the json it returns.