[OpenLayers-Commits] r11020 - trunk/openlayers/lib/OpenLayers/Handler

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Fri Jan 7 17:28:25 EST 2011


Author: tschaub
Date: 2011-01-07 14:28:25 -0800 (Fri, 07 Jan 2011)
New Revision: 11020

Modified:
   trunk/openlayers/lib/OpenLayers/Handler/Box.js
Log:
Clarifying docs and removing a bit of lint.

Modified: trunk/openlayers/lib/OpenLayers/Handler/Box.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Box.js	2011-01-07 22:21:53 UTC (rev 11019)
+++ trunk/openlayers/lib/OpenLayers/Handler/Box.js	2011-01-07 22:28:25 UTC (rev 11020)
@@ -43,22 +43,25 @@
      *
      * Parameters:
      * control - {<OpenLayers.Control>} 
-     * callbacks - {Object} An object containing a single function to be
-     *                          called when the drag operation is finished.
-     *                          The callback should expect to recieve a single
-     *                          argument, the point geometry.
+     * callbacks - {Object} An object with a "done" property whose value is a
+     *     callback to be called when the box drag operation is finished.  
+     *     The callback should expect to recieve a single argument, the box 
+     *     bounds or a pixel. If the box dragging didn't span more than a 5 
+     *     pixel distance, a pixel will be returned instead of a bounds object.
      * options - {Object} 
      */
     initialize: function(control, callbacks, options) {
         OpenLayers.Handler.prototype.initialize.apply(this, arguments);
-        var callbacks = {
-            "down": this.startBox, 
-            "move": this.moveBox, 
-            "out":  this.removeBox,
-            "up":   this.endBox
-        };
         this.dragHandler = new OpenLayers.Handler.Drag(
-                                this, callbacks, {keyMask: this.keyMask});
+            this, 
+            {
+                down: this.startBox, 
+                move: this.moveBox, 
+                out: this.removeBox,
+                up: this.endBox
+            }, 
+            {keyMask: this.keyMask}
+        );
     },
 
     /**



More information about the Commits mailing list