Given this piece of code:

        if (status) {
          map.addOverlay(allRoutes[rtName].route);
          GEvent.addListener(allRoutes[rtName].route, "click", function
() {
            alert(allRoutes[rtName].description); });
          document.getElementById(rtName).checked = true;
        } else {
          map.removeOverlay(allRoutes[rtName].route);
          document.getElementById(rtName).checked = false;
        }

What that piece does is display or remove a particular Polyline
(allRoutes[rtName].route).

How can I add a GEvent.removeListener after the else statement?  The
way I understand it, removeListener() requires a GEvent handler, one
that would get set when the addListener() is originally added, but
since this is a generic piece to handle any Polyline passed to it, I'm
not sure how to deal with the creation of the handler each time.
--~--~---------~--~----~------------~-------~--~----~
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