making ModifyFeature control in standalone mode trigger the beforefeaturemodified event. r=bartvde (closes #3009
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11146 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -351,18 +351,23 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: selectFeature
|
||||
* Called when the select feature control selects a feature.
|
||||
* APIMethod: selectFeature
|
||||
* Select a feature for modification in standalone mode. In non-standalone
|
||||
* mode, this method is called when the select feature control selects a
|
||||
* feature. Register a listener to the beforefeaturemodified event and
|
||||
* return false to prevent feature modification.
|
||||
*
|
||||
* Parameters:
|
||||
* feature - {<OpenLayers.Feature.Vector>} the selected feature.
|
||||
*/
|
||||
selectFeature: function(feature) {
|
||||
this.feature = feature;
|
||||
this.modified = false;
|
||||
this.resetVertices();
|
||||
this.dragControl.activate();
|
||||
this.onModificationStart(this.feature);
|
||||
if (!this.standalone || this.beforeSelectFeature(feature) !== false) {
|
||||
this.feature = feature;
|
||||
this.modified = false;
|
||||
this.resetVertices();
|
||||
this.dragControl.activate();
|
||||
this.onModificationStart(this.feature);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user