Yes that works Thanks Karsten
> -----Original Message----- > From: Andreas Hocevar [mailto:[email protected]] > Sent: Saturday, September 17, 2011 03:49 > To: karsten vennemann > Cc: [email protected] > Subject: Re: [OpenLayers-Users] activate / deactivate events > > Hi Karsten, > > in order to unregister events, you cannot use an anonymous > function. You would have to do something like the following: > > function handler(e) {...} > map.events.register('click', map, handler); > > And then you can simply unregister the event using > > map.events.unregister('click', map, handler); > > Andreas. > > On Sep 17, 2011, at 01:45 , karsten vennemann wrote: > > > Hi all, > > > > I have a click event registered on the map: > > > > map.events.register('click', map, function (e) { ... code to be > > executed... > > } > > How can I activate or deactivate this event ? > > If it was an OpenLayers control called 'infofeature' I could do e.g. > > infofeature.activate(); > > and > > infofeature.deactivate(); > > > > How could I achieve this for the above event ? > > > > Thanks > > Karsten > > > > Karsten Vennemann > > > > Terra GIS LTD > > Seattle, WA 98112 > > USA > > www.terragis.net > > > > _______________________________________________ > > Users mailing list > > [email protected] > > http://lists.osgeo.org/mailman/listinfo/openlayers-users > > > > -- > Andreas Hocevar > OpenGeo - http://opengeo.org/ > Expert service straight from the developers. > > > > > > ======= > Email scanned by PC Tools - No viruses or spyware found. > (Email Guard: 7.0.0.21, Virus/Spyware Database: 6.18330) > http://www.pctools.com/ > ======= _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
