[OpenLayers-Commits] r12248 - in trunk/openlayers:
lib/OpenLayers/Control tests/Control
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Mon Aug 15 12:26:35 EDT 2011
Author: bartvde
Date: 2011-08-15 09:26:34 -0700 (Mon, 15 Aug 2011)
New Revision: 12248
Modified:
trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js
trunk/openlayers/tests/Control/ModifyFeature.html
Log:
deleting a vertex does not set feature.modified, this is a regression since in OL 2.10 a WFS transaction would include all fields, but 2.11 is smarter in the sense that it filters out fields that have not changed in the Transaction XML, which in this case, i.e. deleting a vertex, results in no geometry in the WFS transaction, r=tschaub (pullup #3463)
Modified: trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js 2011-08-14 15:56:33 UTC (rev 12247)
+++ trunk/openlayers/lib/OpenLayers/Control/ModifyFeature.js 2011-08-15 16:26:34 UTC (rev 12248)
@@ -633,6 +633,7 @@
this.layer.drawFeature(this.feature, this.standalone ?
undefined :
this.selectControl.renderIntent);
+ this.modified = true;
this.resetVertices();
this.setFeatureState();
this.onModification(this.feature);
Modified: trunk/openlayers/tests/Control/ModifyFeature.html
===================================================================
--- trunk/openlayers/tests/Control/ModifyFeature.html 2011-08-14 15:56:33 UTC (rev 12247)
+++ trunk/openlayers/tests/Control/ModifyFeature.html 2011-08-15 16:26:34 UTC (rev 12248)
@@ -74,7 +74,7 @@
}
function test_handleKeypress(t) {
- t.plan(14);
+ t.plan(16);
/**
* There are two things that we want to test here
@@ -101,6 +101,8 @@
// mock up vertex deletion
control.dragControl.feature = point;
control.feature = poly;
+ // we cannot use selectFeature since the control is not part of a map
+ control._originalGeometry = poly.geometry.clone();
control.vertices = [point];
point.geometry.parent = {
removeComponent: function(geometry) {
@@ -110,6 +112,7 @@
};
layer.events.on({
"featuremodified": function(event) {
+ t.ok(event.feature.modified !== null, "modified property of feature should have been set");
t.eq(event.feature.id, poly.id, "vertex deletion: featuremodifed triggered");
},
"vertexremoved": function(evt) {
More information about the Commits
mailing list