You can not just make up an event and hope it works.
There is no 'click' event documented for GTrafficOverlay:
http://code.google.com/apis/maps/documentation/reference.html#GTrafficOverlay

Depending on what you want to do in the event handler, you might be
able to listen for the GMap2 click event instead.

--
Marcelo - http://maps.forum.nu
--




On Apr 27, 11:56 am, libin_v <[email protected]> wrote:
> Hi All,
>
> I would like to register an event listener for "Click event" on a
> Traffic Incident. Is this possible? How can this be achieved?
>
> I am trying thing like the below, but it does not work.
>
> function initialize() {
>   map = new GMap2(document.getElementById("map_canvas"));
>   map.setCenter(new GLatLng(49.496675,-102.65625), 3);
>   var trafficOptions = {incidents:true};
>   trafficInfo = new GTrafficOverlay(trafficOptions);
>   map.addControl(new GLargeMapControl());
>   map.addOverlay(trafficInfo);
>   GEvent.addListener(trafficInfo, "click", function() {
>   alert("You clicked the map.");
>   });
>
> }
>
> --
> Regards,
> Libin
--~--~---------~--~----~------------~-------~--~----~
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