[OpenLayers-Users] Event registration in activate function
Andreas Hocevar
ahocevar at opengeo.org
Wed Jan 7 17:33:43 EST 2009
Hi Alexandre,
Alexandre Dube wrote:
> I'm writing my own Control and I need to register some events. Doing
> so in the initialize function isn't good because some objects are not
> created yet ( like the map object ). So I thought I could register them
> in the activate() func and unregister them in the deactivate() func.
>
> So far it was ok to do so, but now I'm facing a problem. I need to
> register events that, when triggered, deactivate the control, and other
> events that, when triggered, reactivate the control. It's a control
> that can contain multiple layers that come from the same source but have
> been normalized to render faster, so the user sees no difference when
> zooming.
I would suggest registering your events in the setMap method of your
control. This will be called when you add the control to the map.
Regards,
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list