ammu
unread,Sep 27, 2011, 4:34:11 PM9/27/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google Maps JavaScript API v3
Hi All,
I am trying to implement street view of a point.
I am calling this from onclick of a link. If street view is not there
for a point then it displays the alert but if available nothing
happens and in error console I see this error:
Uncaught TypeError: Cannot read property 'currentStyle' of null
function streetview(lat1,lng1)
{
var sv = new google.maps.StreetViewService();
var e=new google.maps.LatLng(lat1,lng1);
console.log('loc2'+e);
sv.getPanoramaByLocation(e, 50, processSVData);
var statusLoc;
function processSVData(data, status) {
statusLoc=status;
console.log('status'+statusLoc);
if(statusLoc=='OK')
{
console.log('loc1'+lat1);
console.log('loc2'+lng1);
var panoramaOptions = {
position:e,
pov: {
heading: 165,
pitch:0,
zoom:1
},
enableCloseButton: true
};
var myPano = new
google.maps.StreetViewPanorama(document.getElementById("map_canvas"),
panoramaOptions);
myPano.setVisible(true);
}
else
{
alert("Street View data not found for this location.");
}}}
can someone pls help?