# OpenLayers.Control.DragPan

The DragPan control pans the map with a drag of the mouse.

#### Inherits from

- OpenLayers.Control

Summary

OpenLayers.Control.DragPan | The DragPan control pans the map with a drag of the mouse.
Properties |
type | {OpenLayers.Control.TYPES}
panned | {Boolean} The map moved.
interval | {Integer} The number of milliseconds that should ellapse before panning the map again.
documentDrag | {Boolean} If set to true, mouse dragging will continue even if the mouse cursor leaves the map viewport.
kinetic | {OpenLayers.Kinetic} The OpenLayers.Kinetic object.
enableKinetic | {Boolean} Set this option to enable “kinetic dragging”.
kineticInterval | {Integer} Interval in milliseconds between 2 steps in the “kinetic scrolling”.
Functions |
draw | Creates a Drag handler, using panMap and panMapDone as callbacks.
panMapStart |
panMap |
panMapDone | Finish the panning operation.

### Properties

### type

{OpenLayers.Control.TYPES}

### panned

{Boolean} The map moved.

### interval

{Integer} The number of milliseconds that should ellapse before panning the map again. Defaults to 0 milliseconds, which means that no separate cycle is used for panning. In most cases you won’t want to change this value. For slow machines/devices larger values can be tried out.

### documentDrag

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

### kinetic

{OpenLayers.Kinetic} The OpenLayers.Kinetic object.

### enableKinetic

{Boolean} Set this option to enable “kinetic dragging”. Can be set to true or to an object. If set to an object this object will be passed to the {OpenLayers.Kinetic} constructor. Defaults to true. To get kinetic dragging, ensure that OpenLayers/Kinetic.js is included in your build config.

### kineticInterval

{Integer} Interval in milliseconds between 2 steps in the “kinetic scrolling”. Applies only if enableKinetic is set. Defaults to 10 milliseconds.

### Functions

### draw

> draw: function()

Creates a Drag handler, using panMap and panMapDone as callbacks.

### panMapStart

> panMapStart: function()

### panMap

> panMap: function( | xy | )

#### Parameters

xy | {OpenLayers.Pixel} Pixel of the mouse position

### panMapDone

> panMapDone: function( | xy | )

Finish the panning operation. Only call setCenter (through panMap) if the map has actually been moved.

#### Parameters

xy | {OpenLayers.Pixel} Pixel of the mouse position

> draw: function()

Creates a Drag handler, using panMap and panMapDone as callbacks.

> panMap: function( | xy | )

> panMapDone: function( | xy | )

Finish the panning operation.

> panMapStart: function()

Controls affect the display or behavior of the map.
This class represents a screen coordinate, in x and y coordinates
Close