adding a feature.modified property, making the ModifyFeature control set it and the WFST format check for it so only modified attributes and a modified geometry need to be included in an Update transaction. r=bartvde (closes #3400)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12149 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-07-04 08:37:55 +00:00
parent 3f2bd6ddc2
commit 2293987d57
5 changed files with 140 additions and 6 deletions

View File

@@ -368,6 +368,11 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.dragControl.activate();
this.onModificationStart(this.feature);
}
// keep track of geometry modifications
var modified = feature.modified;
if (feature.geometry && !(modified && modified.geometry)) {
this._originalGeometry = feature.geometry.clone();
}
},
/**
@@ -539,6 +544,13 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
if(this.feature.state != OpenLayers.State.INSERT &&
this.feature.state != OpenLayers.State.DELETE) {
this.feature.state = OpenLayers.State.UPDATE;
if (this.modified && this._originalGeometry) {
var feature = this.feature;
feature.modified = OpenLayers.Util.extend(feature.modified, {
geometry: this._originalGeometry
});
delete this._originalGeometry;
}
}
},