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.

This commit is contained in:
fastr
2012-08-25 23:30:27 +02:00
parent 1d670fcddb
commit 053dba59a1

View File

@@ -23,6 +23,12 @@
OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, { 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 * APIProperty: geometryTypes
* {Array(String)} To restrict modification to a limited set of geometry * {Array(String)} To restrict modification to a limited set of geometry
* types, send a list of strings corresponding to the geometry class * types, send a list of strings corresponding to the geometry class
@@ -245,6 +251,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
// configure the drag control // configure the drag control
var dragOptions = { var dragOptions = {
documentDrag: this.documentDrag,
geometryTypes: ["OpenLayers.Geometry.Point"], geometryTypes: ["OpenLayers.Geometry.Point"],
onStart: function(feature, pixel) { onStart: function(feature, pixel) {
control.dragStart.apply(control, [feature, pixel]); control.dragStart.apply(control, [feature, pixel]);