register: function ( | type, | | obj, | | func | ) |
|
Register an event on the events object.
When the event is triggered, the ‘func’ function will be called, in the context of ‘obj’. Imagine we were to register an event, specifying an OpenLayers.Bounds Object as ‘obj’. When the event is triggered, the context in the callback function will be our Bounds object. This means that within our callback function, we can access the properties and methods of the Bounds object through the “this” variable. So our callback could execute something like:
leftStr = "Left: " + this.left;
or
centerStr = "Center: " + this.getCenterLonLat();
Parameters
type | {String} Name of the event to register |
obj | {Object} The object to bind the context to for the callback#. If no object is specified, default is the Events’s ‘object’ property. |
func | {Function} The callback function. If no callback is specified, this function does nothing. |