Skip to content

Both copy text to your clipboard — Build with AI copies a setup prompt to paste into Claude Code, Cursor, Codex or Copilot; Copy page as Markdown copies this page to paste into a chat. How it works

DragPanHandler ​

Defined in: src/ui/handler/shim/drag_pan.ts:37

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

Methods ​

disable() ​

disable(): void

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

Disables the "drag to pan" interaction.

Returns ​

void

Example ​

ts
map.dragPan.disable();

enable() ​

enable(options?: boolean | DragPanOptions): void

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

Enables the "drag to pan" interaction.

Parameters ​

ParameterTypeDescription
options?boolean | DragPanOptionsOptions object

Returns ​

void

Example ​

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

isActive() ​

isActive(): boolean

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

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.


isEnabled() ​

isEnabled(): boolean

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

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

Returns ​

boolean

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