[OpenLayers-Users] activate / deactivate events

karsten vennemann karsten at terragis.net
Mon Sep 19 22:03:34 EDT 2011


Yes that works
Thanks

Karsten

 

> -----Original Message-----
> From: Andreas Hocevar [mailto:ahocevar at opengeo.org] 
> Sent: Saturday, September 17, 2011 03:49
> To: karsten vennemann
> Cc: users at openlayers.org
> 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
> > Users at lists.osgeo.org
> > 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/
> =======



More information about the Users mailing list