Skip to content

DragPanHandler

The DragPanHandler allows the user to pan the map by clicking and dragging the cursor.

Methods

disable()

disable(): void

Disables the "drag to pan" interaction.

Returns

void

Example

map.dragPan.disable();

Defined in

src/ui/handler/shim/drag_pan.ts:81


enable()

enable(options?: boolean | DragPanOptions): void

Enables the "drag to pan" interaction.

Parameters

Parameter Type Description
options? boolean | DragPanOptions Options object

Returns

void

Example

  map.dragPan.enable();
  map.dragPan.enable({
     linearity: 0.3,
     easing: bezier(0, 0, 0.3, 1),
     maxSpeed: 1400,
     deceleration: 2500,
  });

Defined in

src/ui/handler/shim/drag_pan.ts:66


isActive()

isActive(): boolean

Returns a Boolean indicating whether the "drag to pan" interaction is active, i.e. currently being used.

Returns

boolean

true if the "drag to pan" interaction is active.

Defined in

src/ui/handler/shim/drag_pan.ts:101


isEnabled()

isEnabled(): boolean

Returns a Boolean indicating whether the "drag to pan" interaction is enabled.

Returns

boolean

true if the "drag to pan" interaction is enabled.

Defined in

src/ui/handler/shim/drag_pan.ts:92