[OpenLayers-Commits] r11923 - in trunk/openlayers:
lib/OpenLayers/Handler tests/Handler
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Thu Apr 28 03:09:03 EDT 2011
Author: pgiraud
Date: 2011-04-28 00:09:01 -0700 (Thu, 28 Apr 2011)
New Revision: 11923
Modified:
trunk/openlayers/lib/OpenLayers/Handler/Box.js
trunk/openlayers/tests/Handler/Box.html
Log:
Don't put the box under the cursor until the mouse moved, prevent errors with the GetFeature and click events. I also removed the no longer valid (and failing) tests. r=elemoine, (Closes #2993)
Modified: trunk/openlayers/lib/OpenLayers/Handler/Box.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Box.js 2011-04-28 06:04:47 UTC (rev 11922)
+++ trunk/openlayers/lib/OpenLayers/Handler/Box.js 2011-04-28 07:09:01 UTC (rev 11923)
@@ -99,11 +99,6 @@
this.map.eventsDiv.appendChild(this.zoomBox);
- var offset = this.getBoxOffsets();
- var pos = this.dragHandler.start;
- this.zoomBox.style.left = (pos.x - offset.left) + "px";
- this.zoomBox.style.top = (pos.y - offset.top) + "px";
-
OpenLayers.Element.addClass(
this.map.eventsDiv, "olDrawBox"
);
Modified: trunk/openlayers/tests/Handler/Box.html
===================================================================
--- trunk/openlayers/tests/Handler/Box.html 2011-04-28 06:04:47 UTC (rev 11922)
+++ trunk/openlayers/tests/Handler/Box.html 2011-04-28 07:09:01 UTC (rev 11923)
@@ -39,7 +39,7 @@
map.div.removeChild(testdiv);
var testAll = !isNaN(left);
- t.plan(testAll ? 12 : 2);
+ t.plan(testAll ? 10 : 2);
// we change NaN values to 0 values in the handler's
// boxOffsets object, this is to prevent "invalid
@@ -58,14 +58,10 @@
handler.dragHandler.start = {x: 5, y: 5};
handler.startBox();
offset = handler.getBoxOffsets();
+ handler.moveBox({x: 10, y: 10});
if (testAll) {
t.eq(parseInt(handler.zoomBox.style.left), 5 - offset.left, "x position of box correct");
t.eq(parseInt(handler.zoomBox.style.top), 5 - offset.top, "y position of box correct");
- }
- handler.moveBox({x: 10, y: 10});
- if (testAll) {
- t.eq(parseInt(handler.zoomBox.style.left), 5 - offset.left, "x position of box still correct");
- t.eq(parseInt(handler.zoomBox.style.top), 5 - offset.top, "y position of box still correct");
t.eq(parseInt(handler.zoomBox.style.width), 5 + offset.width + 1, "x dimension of box correct");
t.eq(parseInt(handler.zoomBox.style.height), 5 + offset.height + 1, "y dimension of box correct");
}
More information about the Commits
mailing list