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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user