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
-~----------~----~----~----~------~----~------~--~---