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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…