Revert "DragFeature control should trigger afterfeaturemodified, r=crschmidt (closes #3277)"
This reverts commit a46489db1a.
This commit is contained in:
@@ -26,14 +26,10 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
* send a list of strings corresponding to the geometry class names.
|
* send a list of strings corresponding to the geometry class names.
|
||||||
*/
|
*/
|
||||||
geometryTypes: null,
|
geometryTypes: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: onStart
|
* APIProperty: onStart
|
||||||
* {Function} *Deprecated*. Register for "beforefeaturemodified" instead.
|
* {Function} Define this function if you want to know when a drag starts.
|
||||||
* The "beforefeaturemodified" event is triggered on the layer before
|
|
||||||
* any modification begins.
|
|
||||||
*
|
|
||||||
* Define this function if you want to know when a drag starts.
|
|
||||||
* The function should expect to receive two arguments: the feature
|
* The function should expect to receive two arguments: the feature
|
||||||
* that is about to be dragged and the pixel location of the mouse.
|
* that is about to be dragged and the pixel location of the mouse.
|
||||||
*
|
*
|
||||||
@@ -46,11 +42,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: onDrag
|
* APIProperty: onDrag
|
||||||
* {Function} *Deprecated*. Register for "featuremodified" instead.
|
* {Function} Define this function if you want to know about each move of a
|
||||||
* The "featuremodified" event is triggered on the layer with each
|
|
||||||
* feature modification.
|
|
||||||
*
|
|
||||||
* Define this function if you want to know about each move of a
|
|
||||||
* feature. The function should expect to receive two arguments: the
|
* feature. The function should expect to receive two arguments: the
|
||||||
* feature that is being dragged and the pixel location of the mouse.
|
* feature that is being dragged and the pixel location of the mouse.
|
||||||
*
|
*
|
||||||
@@ -62,11 +54,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: onComplete
|
* APIProperty: onComplete
|
||||||
* {Function} *Deprecated*. Register for "afterfeaturemodified" instead.
|
* {Function} Define this function if you want to know when a feature is
|
||||||
* The "afterfeaturemodified" event is triggered on the layer after
|
|
||||||
* a feature has been modified.
|
|
||||||
*
|
|
||||||
* Define this function if you want to know when a feature is
|
|
||||||
* done dragging. The function should expect to receive two arguments:
|
* done dragging. The function should expect to receive two arguments:
|
||||||
* the feature that is being dragged and the pixel location of the
|
* the feature that is being dragged and the pixel location of the
|
||||||
* mouse.
|
* mouse.
|
||||||
@@ -285,9 +273,6 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
downFeature: function(pixel) {
|
downFeature: function(pixel) {
|
||||||
this.lastPixel = pixel;
|
this.lastPixel = pixel;
|
||||||
this.onStart(this.feature, pixel);
|
this.onStart(this.feature, pixel);
|
||||||
return this.layer.events.triggerEvent(
|
|
||||||
"beforefeaturemodified", {feature: this.feature}
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -305,8 +290,6 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
this.layer.drawFeature(this.feature);
|
this.layer.drawFeature(this.feature);
|
||||||
this.lastPixel = pixel;
|
this.lastPixel = pixel;
|
||||||
this.onDrag(this.feature, pixel);
|
this.onDrag(this.feature, pixel);
|
||||||
this.layer.events.triggerEvent("featuremodified",
|
|
||||||
{feature: this.feature});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -332,9 +315,6 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
*/
|
*/
|
||||||
doneDragging: function(pixel) {
|
doneDragging: function(pixel) {
|
||||||
this.onComplete(this.feature, pixel);
|
this.onComplete(this.feature, pixel);
|
||||||
this.layer.events.triggerEvent("afterfeaturemodified", {
|
|
||||||
feature: this.feature
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -168,13 +168,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_Control_DragFeature_move(t) {
|
function test_Control_DragFeature_move(t) {
|
||||||
t.plan(5);
|
t.plan(3);
|
||||||
var map = new OpenLayers.Map("map");
|
var map = new OpenLayers.Map("map");
|
||||||
var layer = new OpenLayers.Layer.Vector();
|
var layer = new OpenLayers.Layer.Vector();
|
||||||
layer.events.on({
|
|
||||||
'beforefeaturemodified': function(evt) { t.ok(true, "beforefeaturemodified is triggered on the layer"); },
|
|
||||||
'featuremodified': function(evt) { t.ok(true, "featuremodified is triggered on the layer"); }
|
|
||||||
});
|
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
var control = new OpenLayers.Control.DragFeature(layer);
|
var control = new OpenLayers.Control.DragFeature(layer);
|
||||||
map.addControl(control);
|
map.addControl(control);
|
||||||
@@ -261,13 +257,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_Control_DragFeature_done(t) {
|
function test_Control_DragFeature_done(t) {
|
||||||
t.plan(3);
|
t.plan(2);
|
||||||
var map = new OpenLayers.Map("map");
|
var map = new OpenLayers.Map("map");
|
||||||
var layer = new OpenLayers.Layer.Vector();
|
var layer = new OpenLayers.Layer.Vector();
|
||||||
map.addLayer(layer);
|
map.addLayer(layer);
|
||||||
layer.events.on({
|
|
||||||
'afterfeaturemodified': function(evt) { t.ok(true, "afterfeaturemodified is triggered on the layer"); }
|
|
||||||
});
|
|
||||||
var control = new OpenLayers.Control.DragFeature(layer);
|
var control = new OpenLayers.Control.DragFeature(layer);
|
||||||
map.addControl(control);
|
map.addControl(control);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user