diff --git a/lib/OpenLayers/Events.js b/lib/OpenLayers/Events.js index 040ccc870e..3f850f8691 100644 --- a/lib/OpenLayers/Events.js +++ b/lib/OpenLayers/Events.js @@ -77,8 +77,23 @@ OpenLayers.Events.prototype = { /** * @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 + * + * #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) { if (func == null) {