[OpenLayers-Commits] r11086 - in sandbox/elemoine/draw-feature:
lib/OpenLayers/Handler tests/Handler
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Thu Feb 10 05:46:31 EST 2011
Author: erilem
Date: 2011-02-10 02:46:31 -0800 (Thu, 10 Feb 2011)
New Revision: 11086
Modified:
sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Point.js
sandbox/elemoine/draw-feature/tests/Handler/Point.html
Log:
point handler - do not call modifyFeature on mousedown
Modified: sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Point.js
===================================================================
--- sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Point.js 2011-02-10 10:46:23 UTC (rev 11085)
+++ sandbox/elemoine/draw-feature/lib/OpenLayers/Handler/Point.js 2011-02-10 10:46:31 UTC (rev 11086)
@@ -333,7 +333,6 @@
*/
mousedown: function(evt) {
this.lastDown = evt.xy;
- this.modifyFeature(evt.xy);
return !this.stopDown;
},
Modified: sandbox/elemoine/draw-feature/tests/Handler/Point.html
===================================================================
--- sandbox/elemoine/draw-feature/tests/Handler/Point.html 2011-02-10 10:46:23 UTC (rev 11085)
+++ sandbox/elemoine/draw-feature/tests/Handler/Point.html 2011-02-10 10:46:31 UTC (rev 11086)
@@ -142,7 +142,7 @@
}
function test_callbacks(t) {
- t.plan(25);
+ t.plan(23);
var map = new OpenLayers.Map("map", {
resolutions: [1]
});
@@ -181,14 +181,7 @@
// mouse down
handler.mousedown(
{type: "mousedown", xy: new OpenLayers.Pixel(0, 0)});
- t.eq(logs.length, 1, "[mousedown] called back");
- log = logs.shift();
- t.eq(log.type, "modify", "[mousedown] modified called");
- t.geom_eq(log.args[0], new OpenLayers.Geometry.Point(-150, 75),
- "[mousedown] correct point");
- t.geom_eq(log.args[1].geometry,
- new OpenLayers.Geometry.Point(-150, 75),
- "[mousedown] correct feature");
+ t.eq(logs.length, 0, "[mousedown] not called back");
// mouse move
handler.mousemove(
{type: "mousemove", xy: new OpenLayers.Pixel(1, 0)});
@@ -203,17 +196,21 @@
// mouse up (no finalize - we moved)
handler.mouseup({type: "mouseup", xy: new OpenLayers.Pixel(1, 0)});
t.eq(logs.length, 0, "[mouseup] not called back");
- // mouse down
- handler.mousedown(
- {type: "mousedown", xy: new OpenLayers.Pixel(2, 0)});
- t.eq(logs.length, 1, "[mousedown] called back");
+ // mouse move
+ handler.mousemove(
+ {type: "mousemove", xy: new OpenLayers.Pixel(2, 0)});
+ t.eq(logs.length, 1, "[mousemove] called back");
log = logs.shift();
- t.eq(log.type, "modify", "[mousedown] modified called");
+ t.eq(log.type, "modify", "[mousemove] modify called");
t.geom_eq(log.args[0], new OpenLayers.Geometry.Point(-148, 75),
- "[mousedown] correct point");
+ "[mousemove] correct point");
t.geom_eq(log.args[1].geometry,
new OpenLayers.Geometry.Point(-148, 75),
- "[mousedown] correct feature");
+ "[mousemove] correct feature");
+ // mouse down
+ handler.mousedown(
+ {type: "mousedown", xy: new OpenLayers.Pixel(2, 0)});
+ t.eq(logs.length, 0, "[mousedown] not called back");
// mouse up
handler.mouseup({type: "mouseup", xy: new OpenLayers.Pixel(2, 0)});
t.eq(logs.length, 2, "[mouseup] called back twice");
More information about the Commits
mailing list