Remove Event Listener from map

4194
1
09-14-2011 02:19 PM
JohnGarvey
New Contributor
This feels easy but...

I have a tool that listens for map clicks on the map. When the tool is minimized I want to remove the event listener. I don't have any follow-up action to do in a callback function and I can't exclude the listener function. Aside from creating a doNothing function, is there something else.

tool.removeEventListener(MapMouseEvent.MAP_CLICK, ?)
Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
John,

   You use the same exact function that you gave the addEventListener when you use the removeEventListener

Example:

tool.addEventListener(MapMouseEvent.MAP_CLICK, MapMouseHandler);
tool.removeEventListener(MapMouseEvent.MAP_CLICK, MapMouseHandler);
0 Kudos