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