Draw and modify controls now set feature state. No longer do we need to check feature state in app code in cases where features are created or modified with these controls. r=elemoine,ahocevar (closes #1833)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8382 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-11-16 18:26:39 +00:00
parent 1566fc252e
commit d5950d4b29
7 changed files with 22 additions and 20 deletions

View File

@@ -77,6 +77,7 @@ OpenLayers.Control.DrawFeature = OpenLayers.Class(OpenLayers.Control, {
*/
drawFeature: function(geometry) {
var feature = new OpenLayers.Feature.Vector(geometry);
feature.state = OpenLayers.State.INSERT;
this.layer.addFeatures([feature]);
this.featureAdded(feature);
this.events.triggerEvent("featureadded",{feature : feature});