I am passing lat and lng variables and display google sreet view in a div. The problem is that when the StreetView is unavilable then nothing is displayed. I would like to check if there is a streetview for a given lat and lng and display a message. Here is my code:
var myPano = new GStreetviewPanorama(document.getElementById("street2"), panoOpts);
var location = new GLatLng(lat,lng)
myPano.setLocationAndPOV(location);
Maybe I should use something like: Event.addListener(myPano, "error", errorMessage());
Any ideas?
getPanoramaByLocation
is asynchronous. Meaning anything you want to do as a result of the check has to go into the call back function. – Recrudescence