[OpenLayers-Users] Handling events

Erik Uzureau euzuro at gmail.com
Fri Nov 3 09:34:41 EST 2006


Hi Alan,

Event.register() is the one you should be using.

Event.observe() is a Prototype.js function, which we have phased out in OL 2.2.

If you look through lib/Events.js you'll see we've brought over
remnants of the Prototype.js code into the same file. The bonafide
OpenLayers Events object is defined at the bottom of the page. It
allows for custom events to be defined.

Can anyone else on the list offer some advice for Alan on how to use
the Events object?

Thanks,
Erik



On 11/1/06, Alan U <alan.underwood at hotmail.co.uk> wrote:
>
> Sorry if you've already received this message before, but I'm having issues
> with nabble...
>
> I was wondering (=desperately hoping) that someone might be able to describe
> how the event handling is supposed to be used in the openlayers code.
> I am trying to write my own control for creating layers and markers and, as
> you would expect, it needs to use a lot of event handling. I've looked at
> the LayerSwitcher control which sometimes uses Events.register on the map
> object and sometimes uses Event.observe and I looked at PanZoomBar which
> uses Events.register on both the map object and on some Events objects it
> defines itself. I got quite confused.
>
> When is Events.register supposed to be used rather that Event.observe and
> vice-versa.
>
> Any guidance?
>
> Alan
> --
> View this message in context: http://www.nabble.com/Handling-events-tf2551102.html#a7110412
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>



More information about the Users mailing list