Ok, so would it at all be possible to pass an argument to my handler
function? example:
Function my_click_handler(myarg){...}
GEvent.addListener(map,'click',my_click_handler(somevar));
Can something like this be done?
Thanks again,
P.Romero
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Andrew Leach
Sent: 2009-04-04 2:56 AM
To: Google Maps API
Subject: Re: overlay redraw on 'movend/dragend' events...'this.Ch is
undefined' error
On Apr 4, 9:12 am, <[email protected]> wrote:
> I was under the impression that it was ok to pass the name of an existing
> function to GEvent.addListener, such as.
>
> GEvent.addListener(map,'click',my_click_handler());
In this case, you are not passing a function, but the result of a
function. Adding the brackets causes the function to be evaluated:
that means that when there's a map click, the handler function which
the API attempts to run is (probably) a value of null or false. Try
GEvent.addListener(map,'click',my_click_handler);
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
-~----------~----~----~----~------~----~------~--~---