From ca70bcf928a3ed3bfc278babfbd46147ba74fd65 Mon Sep 17 00:00:00 2001 From: bartvde Date: Mon, 6 Jun 2011 11:43:50 +0000 Subject: [PATCH] Box Handler missing start callback, r=pgiraud (closes #3324) git-svn-id: http://svn.openlayers.org/trunk/openlayers@12051 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Handler/Box.js | 15 ++++++++++----- tests/Handler/Box.html | 20 +++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/lib/OpenLayers/Handler/Box.js b/lib/OpenLayers/Handler/Box.js index caa07dfb05..ca89c5e9f5 100644 --- a/lib/OpenLayers/Handler/Box.js +++ b/lib/OpenLayers/Handler/Box.js @@ -43,12 +43,16 @@ OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, { * * Parameters: * control - {} - * 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 + * callbacks - {Object} An object with a properties whose values are + * functions. Various callbacks described below. + * options - {Object} + * + * Named callbacks: + * start - Called when the box drag operation starts. + * done - Called when the box drag operation is finished. + * The callback should expect to receive 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); @@ -89,9 +93,10 @@ OpenLayers.Handler.Box = OpenLayers.Class(OpenLayers.Handler, { * Method: startBox * * Parameters: - * evt - {Event} + * xy - {} */ startBox: function (xy) { + this.callback("start", []); this.zoomBox = OpenLayers.Util.createDiv('zoomBox', new OpenLayers.Pixel(-9999, -9999)); this.zoomBox.className = this.boxDivClassName; diff --git a/tests/Handler/Box.html b/tests/Handler/Box.html index 950ea7021a..edb20d053d 100644 --- a/tests/Handler/Box.html +++ b/tests/Handler/Box.html @@ -3,16 +3,17 @@