# OpenLayers.Control.DragFeature

The DragFeature control moves a feature with a drag of the mouse. Create a new control with the OpenLayers.Control.DragFeature constructor.

#### Inherits From

- OpenLayers.Control

Summary

OpenLayers.Control.DragFeature | The DragFeature control moves a feature with a drag of the mouse.
Properties |
geometryTypes | {Array(String)} To restrict dragging to a limited set of geometry types, send a list of strings corresponding to the geometry class names.
onStart | {Function} Define this function if you want to know when a drag starts.
onDrag | {Function} Define this function if you want to know about each move of a feature.
onComplete | {Function} Define this function if you want to know when a feature is done dragging.
onEnter | {Function} Define this function if you want to know when the mouse goes over a feature and thereby makes this feature a candidate for dragging.
onLeave | {Function} Define this function if you want to know when the mouse goes out of the feature that was dragged.
documentDrag | {Boolean} If set to true, mouse dragging will continue even if the mouse cursor leaves the map viewport.
Constructor |
OpenLayers.Control.DragFeature | Create a new control to drag features.
Functions |
destroy | Take care of things that are not handled in superclass
activate | Activate the control and the feature handler.
deactivate | Deactivate the control and all handlers.

### Properties

### geometryTypes

{Array(String)} To restrict dragging to a limited set of geometry types, send a list of strings corresponding to the geometry class names.

### onStart

{Function} Define this function if you want to know when a drag starts. The function should expect to receive two arguments: the feature that is about to be dragged and the pixel location of the mouse.

#### Parameters

feature | {OpenLayers.Feature.Vector} The feature that is about to be dragged.
pixel | {OpenLayers.Pixel} The pixel location of the mouse.

### onDrag

{Function} Define this function if you want to know about each move of a feature. The function should expect to receive two arguments: the feature that is being dragged and the pixel location of the mouse.

#### Parameters

feature | {OpenLayers.Feature.Vector} The feature that was dragged.
pixel | {OpenLayers.Pixel} The pixel location of the mouse.

### onComplete

{Function} Define this function if you want to know when a feature is done dragging. The function should expect to receive two arguments: the feature that is being dragged and the pixel location of the mouse.

#### Parameters

feature | {OpenLayers.Feature.Vector} The feature that was dragged.
pixel | {OpenLayers.Pixel} The pixel location of the mouse.

### onEnter

{Function} Define this function if you want to know when the mouse goes over a feature and thereby makes this feature a candidate for dragging.

#### Parameters

feature | {OpenLayers.Feature.Vector} The feature that is ready to be dragged.

### onLeave

{Function} Define this function if you want to know when the mouse goes out of the feature that was dragged.

#### Parameters

feature | {OpenLayers.Feature.Vector} The feature that was dragged.

### documentDrag

{Boolean} If set to true, mouse dragging will continue even if the mouse cursor leaves the map viewport. Default is false.

### Constructor

### OpenLayers.Control.DragFeature

Create a new control to drag features.

#### Parameters

layer | {OpenLayers.Layer.Vector} The layer containing features to be dragged.
options | {Object} Optional object whose properties will be set on the control.

### Functions

### destroy

> destroy: function()

Take care of things that are not handled in superclass

### activate

> activate: function()

Activate the control and the feature handler.

#### Returns

{Boolean} Successfully activated the control and feature handler.

### deactivate

> deactivate: function()

Deactivate the control and all handlers.

#### Returns

{Boolean} Successfully deactivated the control.

> destroy: function()

Take care of things that are not handled in superclass

> activate: function()

Activate the control and the feature handler.

> deactivate: function()

Deactivate the control and all handlers.
Create a new control to drag features.
Controls affect the display or behavior of the map.
Vector features use the OpenLayers.Geometry classes as geometry description.
This class represents a screen coordinate, in x and y coordinates
Instances of OpenLayers.Layer.Vector are used to render vector data from a variety of sources.
Close