Do not call preFeatureInsert() and onFeatureInsert() callbacks when the modify feature control and the regular polygon handler internally adds point geometries to the layer. This is accomplished by adding an 'options' argument to the addFeatures() method in Layer.Vector. If that options argument has the silent property set to true, then the preFeatureInsert() and onFeatureInsert() callbacks aren't called. Thanks tschaub and fredj for your input. Thanks crschmidt for the final review. (closes #1148)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5470 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Éric Lemoine
2007-12-17 14:36:39 +00:00
parent ccf16fa024
commit dc2cc625f3
4 changed files with 33 additions and 9 deletions

View File

@@ -514,8 +514,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
}
}
collectComponentVertices.call(this, this.feature.geometry);
this.layer.addFeatures(this.vertices);
this.layer.addFeatures(this.virtualVertices);
this.layer.addFeatures(this.vertices, {silent: true});
this.layer.addFeatures(this.virtualVertices, {silent: true});
},
/**
@@ -534,7 +534,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
geometry.move(x, y);
}
this.dragHandle = origin;
this.layer.addFeatures([this.dragHandle]);
this.layer.addFeatures([this.dragHandle], {silent: true});
},
/**
@@ -574,7 +574,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
}
}
this.radiusHandle = radius;
this.layer.addFeatures([this.radiusHandle]);
this.layer.addFeatures([this.radiusHandle], {silent: true});
},
/**