I removed my post to edit it but wasn't fast enough and Rossko
supplied the answer here 
http://groups.google.com/group/google-maps-api/browse_thread/thread/c8d06bd7bc76cdae#

Thanks Rossko

On Dec 8, 12:01 pm, Steve <[email protected]> wrote:
> When I use GEvent.addListener like this:
>
> GEvent.addListener(marker, "dblclick", function() {
>     alert("you clicked twice");
>
> });
>
> or like this:
>
> function drawLine (){
>     alert("you clicked twice");}
>
> GEvent.addListener(marker, "dblclick", function() {
>     drawLine();
>
> });
>
> everything works fine. But if I do it like this the function is called
> without a doubleclick:
>
> function drawLine (){
>     alert("you clicked twice");}
>
> GEvent.addListener(marker, "dblclick", drawLine());
>
> It seems that GEvent.addListener requires "function(){}" and cannot
> accept function call instead. Could someone please explain why this
> is?
> I wrote a few Google Maps applications a few years ago and am working
> on a new one now but I seem to have forgotten some basics :-(
>
> Regards, Steve.

--

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.


Reply via email to