Send events when modifying features:

'beforefeaturemodified' triggered when a feature is selected to be modified,
  'featuremodified' triggered when a feature has been modified,
  'afterfeaturemodified' triggered when a feature is finished being modified

r=tschaub (Closes #1358)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@6413 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Frédéric Junod
2008-02-29 06:50:39 +00:00
parent 5f93cc2b52
commit 8b91ee8d64
3 changed files with 97 additions and 130 deletions

View File

@@ -289,6 +289,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.resetVertices();
this.dragControl.activate();
this.onModificationStart(this.feature);
this.layer.events.triggerEvent("beforefeaturemodified",
{feature: this.feature});
},
/**
@@ -315,6 +317,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.feature = null;
this.dragControl.deactivate();
this.onModificationEnd(object.feature);
this.layer.events.triggerEvent("afterfeaturemodified",
{feature: object.feature});
},
/**
@@ -428,6 +432,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
dragComplete: function(vertex) {
this.resetVertices();
this.onModification(this.feature);
this.layer.events.triggerEvent("featuremodified",
{feature: this.feature});
},
/**
@@ -500,6 +506,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
this.selectControl.renderIntent);
this.resetVertices();
this.onModification(this.feature);
this.layer.events.triggerEvent("featuremodified",
{feature: this.feature});
}
}
},