Adding a 'sketchstarted' event on the vector layer. This event is triggered at the start of each new sketch. r=ahocevar (closes #1945)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9269 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
}
|
||||
|
||||
function test_callbacks(t) {
|
||||
t.plan(12);
|
||||
t.plan(15);
|
||||
var map = new OpenLayers.Map("map", {
|
||||
resolutions: [1]
|
||||
});
|
||||
@@ -83,6 +83,10 @@
|
||||
});
|
||||
var log = {};
|
||||
var handler = new OpenLayers.Handler.Path(control, {
|
||||
create: function() {
|
||||
log.type = "create",
|
||||
log.args = arguments
|
||||
},
|
||||
modify: function() {
|
||||
log.type = "modify",
|
||||
log.args = arguments
|
||||
@@ -103,6 +107,9 @@
|
||||
// mock up feature drawing
|
||||
handler.activate();
|
||||
handler.mousedown({type: "mousedown", xy: new OpenLayers.Pixel(0, 0)});
|
||||
t.eq(log.type, "create", "[mousedown] create called");
|
||||
t.geom_eq(log.args[0], new OpenLayers.Geometry.Point(-150, 75), "[mousedown] correct vertex");
|
||||
t.ok(log.args[1] === handler.line, "[mousedown] correct sketch feature");
|
||||
handler.mouseup({type: "mouseup", xy: new OpenLayers.Pixel(0, 0)});
|
||||
t.eq(log.type, "modify", "[mouseup] modify called");
|
||||
t.geom_eq(log.args[0], new OpenLayers.Geometry.Point(-150, 75), "[mouseup] correct vertex");
|
||||
|
||||
Reference in New Issue
Block a user