OpenLayers.Control.DragFeature - OpenLayers

# OpenLayers. Control. DragFeature

Move a feature with a drag. Create a new control with the OpenLayers.Control.DragFeature constructor.

#### Inherits From

- OpenLayers.Control

Summary

OpenLayers. Control. DragFeature | Move a feature with a drag.
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.
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.

### 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