Thanks Rossko for the suggestions.
I don't think it's an issue with scope because if I had only 1 event
linked to the Poly,
ie, either
GEvent.addListener(poly2, 'click', function(point){
// map.openInfoWindowHtml(point, title)
m_pano.setLocationAndPOV(point);
});
or
GEvent.addListener(poly2, 'click', function(point){
map.openInfoWindowHtml(point, title)
// m_pano.setLocationAndPOV(point);
});
they work fine.
I will have a look at function closures and will give that a shot.
Thanks
On Aug 16, 12:44 pm, Rossko <[email protected]> wrote:
> > map is available at:http://ws9.saht.co.za/temp/test4.asp
>
> Your objects 'map' and 'myPano' are declared in local scope within
> your load_map() function.
> After that function has finished, they won't be available anymore, so
> your map-click function never runs.http://econym.org.uk/gmap/scope.htm
>
> Your createPolygon() function happens to get function closure on them,
> so the poly-click listener does run, which is probably a bit
> confusing!http://econym.org.uk/gmap/closure.htm
>
> It's easiest to make 'map' and 'myPano' into global objects.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---