On Oct 13, 3:46 pm, Rossko <[EMAIL PROTECTED]> wrote:
> See this recent thread about click listener(s) -
>    http://groups.google.com/group/Google-Maps-API/browse_thread/thread/6...
>
> I can't beat Larry's words, quote -
>
> "You probably want to use the arguments of the map "click" 
> listener:http://code.google.com/apis/maps/documentation/reference.html#GMap2.E...
..snip..
> cheers, Ross K

Hi Ross. Thanks for the quick response. I read through the thread you
sent me, and you're right, adding a click listener to the map, rather
than to each marker, is probably a more effective approach.

Unfortunately, when I pass the map variable into the "source" argument
of addListener(), an error within the Google Maps API occurs.

Here's the new listener, acting on the map instead of a marker:

GEvent.addListener(RentalMap, 'click',
  function(overlay, latlng, overlaylatlng) {
    console.debug('overlay = [' + overlay + ']');
    console.debug('latlng  = [' + latlng + ']');
    console.debug('overlaylatlng  = [' + overlaylatlng + ']');
    }
  );

However, when I reload the page, Firebug spits out this error:

a is undefined
http://maps.google.com/intl/en_ALL/mapfiles/132d/maps2.api/main.js
Line 266

Any thoughts on what might be going on? Cheers,
Nick
--~--~---------~--~----~------------~-------~--~----~
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