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

Google Maps API v3 getPanoramaByLocation (StreetView)


I'm working on a project that picks random locations world-wide and need some functionality from Google Street View. I'm working with API v3 of Google Maps. The question I have is with the getPanoramaByLocation method. According to the Google docs, getPanoramaByLocation is :

"Retrieves the StreetViewPanoramaData for a panorama within a given radius of the given LatLng. The StreetViewPanoramaData is passed to the provided callback. If the radius is less than 50 meters, the nearest panorama will be returned."

The part I'm interested in is where it says "less than 50 meters, returns nearest panorama." So, for example, if I put in coordinates for somewhere in the middle of the Congo (where there isn't a street view for miles and miles), it should return a panorama of the nearest available street view. But it's not, it's returning null every time.

Is there a limit to how far away it looks?

Here's my Fiddle :

http://jsfiddle.net/nrJBP/1/

Thanks all, and hopefully this helps anyone in the future.


Solution

  • The service searches within the radius you give, as the docs state. You specify the maximum radius.

    The service could find any Panorama data within the radius, except if you specify 50m, when it will always find the nearest (within that 50m).