Thanks Andrew, The latlng is not null. I think the error is at: myPano.setLocationAndPOV(latlng);
I put an alert statement just before myPano.setLocationAndPOV(latlng); and alert fired fine with the latlng values but street view div did not show and the error this.o is null still comes up. Any ideas? Thanks, Ismail On Aug 11, 4:04 pm, Andrew Leach <[email protected]> wrote: > On Aug 11, 2:43 pm, iNishana <[email protected]> wrote: > > > > > But now I am trying to attach a streetview by adding: > > > svOverlay = new GStreetviewOverlay(); > > map.addOverlay(svOverlay); > > > GEvent.addListener(map,"click", function(overlay,latlng) { > > myPano.setLocationAndPOV(latlng); > > }); > > > and the error I get is: > > <b>this.o is null </b> > > But Mike wrote > > > > Map click events can either return a point or an overlay. > > So if you click on an overlay, latlng is null. However there is a > third parameter which contains the coordinates of the click on the > overlay. You need to supply myPano with a latlng whether the click was > on the overlay or not: > > GEvent.addListener(map,"click", function > (overlay,ptlatlng,ovlatlng) { > var latlng = ptlatlng || ovlatlng; > myPano.setLocationAndPOV(latlng); > }); > > Andrew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
