OpenLayers.Handler.Drag

The drag handler is used to deal with sequences of browser events related to dragging.  The handler is used by controls that want to know when a drag sequence begins, when a drag is happening, and when it has finished.

Controls that use the drag handler typically construct it with callbacks for ‘down’, ‘move’, and ‘done’.  Callbacks for these keys are called when the drag begins, with each move, and when the drag is done.  In addition, controls can have callbacks keyed to ‘up’ and ‘out’ if they care to differentiate between the types of events that correspond with the end of a drag sequence.  If no drag actually occurs (no mouse move) the ‘down’ and ‘up’ callbacks will be called, but not the ‘done’ callback.

Create a new drag handler with the OpenLayers.Handler.Drag constructor.

Inherits from

Summary
OpenLayers.Handler.DragThe drag handler is used to deal with sequences of browser events related to dragging.
Properties
documentDrag{Boolean} If set to true, the handler will also handle mouse moves when the cursor has moved out of the map viewport.
Constructor
OpenLayers.Handler.DragReturns OpenLayers.Handler.Drag

Properties

documentDrag

{Boolean} If set to true, the handler will also handle mouse moves when the cursor has moved out of the map viewport.  Default is false.

Constructor

OpenLayers.Handler.Drag

Returns OpenLayers.Handler.Drag

Parameters

control{OpenLayers.Control} The control that is making use of this handler.  If a handler is being used without a control, the handlers setMap method must be overridden to deal properly with the map.
callbacks{Object} An object containing a single function to be called when the drag operation is finished.  The callback should expect to receive a single argument, the pixel location of the event.  Callbacks for ‘move’ and ‘done’ are supported.  You can also speficy callbacks for ‘down’, ‘up’, and ‘out’ to respond to those events.
options{Object}
Returns OpenLayers.Handler.Drag
Base class to construct a higher-level handler for event sequences.
Controls affect the display or behavior of the map.
Close