How to check if Google Street View available and display message?

Posted by Vafello on Stack Overflow See other posts from Stack Overflow or by Vafello
Published on 2010-04-20T12:29:01Z Indexed on 2010/04/20 12:33 UTC
Read the original article Hit count: 163

Filed under:
|

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?

© Stack Overflow or respective owner

Related posts about google

Related posts about maps