I have a question regarding GEvent.addListener(map, "click" function(){...}). I couldn't find any information about what it returns in the callback function in the GMaps reference. Can you provide some insight on this? The documentation mentions two parameters, "overlay" and "latLng", but it seems like the names of these parameters are not important. I could rename them to "foo" and "bar" for all I know. However, it appears that the "overlay" parameter is empty anyway.
I am also having difficulties passing these parameters directly into a callback function that I created. Here is the code snippet:
GEvent.addListener(gmap, "click", generateMarker(overlay, latLng));
Instead of the above code, which doesn't work as expected, I found that this code works fine:
GEvent.addListener(gmap, "click", function(overlay, latLng) {
generateMarker(overlay, latLng);
});