In standalone mode, allow only dragging of sketch vertices or the point

selected for modification. Thanks tschaub for the improved patch. 
r=tschaub (closes #2219)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9613 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-08-05 23:33:26 +00:00
parent 868f886cad
commit 01d4330c81
2 changed files with 43 additions and 3 deletions

View File

@@ -236,6 +236,22 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
},
onComplete: function(feature) {
control.dragComplete.apply(control, [feature]);
},
featureCallbacks: {
over: function(feature) {
/**
* In normal mode, the feature handler is set up to allow
* dragging of all points. In standalone mode, we only
* want to allow dragging of sketch vertices and virtual
* vertices - or, in the case of a modifiable point, the
* point itself.
*/
if(control.standalone !== true || feature._sketch ||
control.feature === feature) {
control.dragControl.overFeature.apply(
control.dragControl, [feature]);
}
}
}
};
this.dragControl = new OpenLayers.Control.DragFeature(