All of the sudden I appear to be getting inaccurate status codes from the Google Maps Javascript API. For example, with this code:
sv.getPanorama({
location: {lat: 35.685, lng: 139.7514},
radius: 350
}, function(data, status) {
console.log("getPano() location = "+data.location.latLng);
console.log("getPano() panoID = "+data.location.pano);
console.log("getPano() status = "+status);
});
With this, I get the following output:
new getPano() location = (35.685175, 139.75279950000004)
getPano() panoID = F:-2eRkGOODHZg/VtKZ7EGeepI/AAAAAAAADLY/Fvhw3HeTfXcAVq0wuHxq22LnoTtpeUx2A
getPano() status = OK
When I try to build a request URL based on this data, such as:
https://maps.googleapis.com/maps/api/streetview?size=640x540&location=35.685175,139.75279950000004
or with the pano ID:
https://maps.googleapis.com/maps/api/streetview?size=640x540&pano=F:-2eRkGOODHZg/VtKZ7EGeepI/AAAAAAAADLY/Fvhw3HeTfXcAVq0wuHxq22LnoTtpeUx2A
I get the "Sorry, we have no imagery here." image. In other words, even though the status came back as OK
, there is no pano available at this location. Visiting Google Maps manually for this latLng
bears this out. Google does have satellite imagery for that location, but not a Street View pano.
This code used to work, so I'm confused as to what is going on. Why is the API returning an OK pano status for this location when the panoID and latLng point to no image?
UPDATE: I would appreciate any confirmations that my findings are the same for others (e.g. that it's not something I'm doing wrong), and, any ideas for workarounds. My app is one that pulls up static street view images for latLng locations, but if there isn't a street view image available I shift to satellite. I use the getPanorama() status to determine which direction to take.