Appended is a bookmarklet to be used on http://maps.google.com/
It will install a listener for clicks onto Google Maps and display the
geographic coordinates of the spot clicked on. This works fine.
Afterwards I would like to remove the listener, so the bookmarklet
would work once and only once. I tried to use
  GEvent.removeListener(..) and
  GEvent.clearListeners(..) ,
but NONE OF THEM WORKED!
I use Firefox 3.0.5 on WinXP32.
Any help would be very much appreciated!

javascript:void(mylistener=GEvent.addListener(gApplication.getMap
(),"click",
function(marker,point){
  txt = "You clicked at: <" + point + ">\n";
  txt = txt + "Mylistener: <" + mylistener + ">\n";
  alert(txt);
  txt = "None of these works: \n";
  GEvent.removeListener(mylistener);
  GEvent.clearListeners(gApplication.getMap(), "click");
  txt = txt + "------------------------- \n";
  alert(txt);
  }););

--~--~---------~--~----~------------~-------~--~----~
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