From 053dba59a15f690fbf361c0c78f3262d60bea692 Mon Sep 17 00:00:00 2001 From: fastr Date: Sat, 25 Aug 2012 23:30:27 +0200 Subject: [PATCH 1/2] Inserted documentDrag in ModifyFeature so that you can drag vertices over the viewport of the map in analogy to the DragFeature-Control. documentDrag is internaly passed to the DragFreature that's used by ModifyFeature. --- lib/OpenLayers/Control/ModifyFeature.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/OpenLayers/Control/ModifyFeature.js b/lib/OpenLayers/Control/ModifyFeature.js index 4dc2347e04..d5fe2e6df6 100644 --- a/lib/OpenLayers/Control/ModifyFeature.js +++ b/lib/OpenLayers/Control/ModifyFeature.js @@ -22,6 +22,12 @@ */ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { + /** + * APIProperty: documentDrag + * {Boolean} If set to true, dragging vertices will continue even if the + * mouse cursor leaves the map viewport. Default is false. + */ + documentDrag: false, /** * APIProperty: geometryTypes * {Array(String)} To restrict modification to a limited set of geometry @@ -245,6 +251,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { // configure the drag control var dragOptions = { + documentDrag: this.documentDrag, geometryTypes: ["OpenLayers.Geometry.Point"], onStart: function(feature, pixel) { control.dragStart.apply(control, [feature, pixel]); From e8716847f8c82bebe17c518437b3f0c71f11bfc8 Mon Sep 17 00:00:00 2001 From: fastr Date: Sat, 25 Aug 2012 23:37:39 +0200 Subject: [PATCH 2/2] Adding DocumentDrag to ModifyFeature --- lib/OpenLayers/Control/ModifyFeature.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/OpenLayers/Control/ModifyFeature.js b/lib/OpenLayers/Control/ModifyFeature.js index d5fe2e6df6..c5a4741fa0 100644 --- a/lib/OpenLayers/Control/ModifyFeature.js +++ b/lib/OpenLayers/Control/ModifyFeature.js @@ -28,6 +28,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { * mouse cursor leaves the map viewport. Default is false. */ documentDrag: false, + /** * APIProperty: geometryTypes * {Array(String)} To restrict modification to a limited set of geometry