Google street view is a pretty cool widget and also now available for significant amount of areas around the world. It would certainly be very cool to add not only the Google maps in your website but the Google Street view as well. It also is pretty easy to do that, below is all the code you need to add it you just need to know the latitude longitude of the location you want it to show and also it should be on google street view map already of course..
<html> <head> <title>Google Street View Demo</title> <script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAp3yqex2QwxZSXQAIGTbL3hQSgN1zkvCdoYVlIYXAwl5r0QbsLBRmauXS9xhCcCs1sTwzbq-Bk3qoZw" type="text/javascript"></script> <script> function load() { if (GBrowserIsCompatible()) { var thePano = new GLatLng(latitude_of_your_desired_location,longitude_of_your_desired_location); panoramaOptions = { latlng:thePano, userPhotos: false }; var myPano = new GStreetviewPanorama(document.getElementById("pano"), panoramaOptions); GEvent.addListener(myPano, "error", handleNoFlash); } } function handleNoFlash(errorCode) { if (errorCode == FLASH_UNAVAILABLE) { return; } } window.onload = load; window.onunload = GUnload; </script> </head> <body> <div style="margin-left:15px;"><b>Adding Google Street View to the website is super easy..</b></div> <div name="pano" id="pano" style="width: 1024px; height: 800px;border:solid #ccc 1px;margin-left:15px;"></div> </body> </html> |
Click here for a working demo.