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. _______________________________________________ Users mailing list [email protected] http://openlayers.org/mailman/listinfo/users
