add more complete comment to register function, sort of explaining binding.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@865 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -77,8 +77,23 @@ OpenLayers.Events.prototype = {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {String} type Name of the event to register
|
* @param {String} type Name of the event to register
|
||||||
* @param {Object} obj The object to bind the context to for the callback
|
* @param {Object} obj The object to bind the context to for the callback#
|
||||||
* @param {Function} func The callback function
|
* @param {Function} func The callback function
|
||||||
|
*
|
||||||
|
* #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:
|
||||||
|
*
|
||||||
|
* alert("Left: " + this.left);
|
||||||
|
*
|
||||||
|
* or
|
||||||
|
*
|
||||||
|
* alert("Center: " + this.getCenterLonLat());
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
register: function (type, obj, func) {
|
register: function (type, obj, func) {
|
||||||
if (func == null) {
|
if (func == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user