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

KeyboardHandler ​

Defined in: src/ui/handler/keyboard.ts:27

The KeyboardHandler allows the user to zoom, rotate, and pan the map using the following keyboard shortcuts:

  • = / +: Increase the zoom level by 1.
  • Shift-= / Shift-+: Increase the zoom level by 2.
  • -: Decrease the zoom level by 1.
  • Shift--: Decrease the zoom level by 2.
  • Arrow keys: Pan by 100 pixels.
  • Shift+⇢: Increase the rotation by 15 degrees.
  • Shift+⇠: Decrease the rotation by 15 degrees.
  • Shift+⇡: Increase the pitch by 10 degrees.
  • Shift+⇣: Decrease the pitch by 10 degrees.

Implements ​

Methods ​

disable() ​

disable(): void

Defined in: src/ui/handler/keyboard.ts:156

Disables the "keyboard rotate and zoom" interaction.

Returns ​

void

Example ​

ts
map.keyboard.disable();

Implementation of ​

Handler.disable


disableRotation() ​

disableRotation(): void

Defined in: src/ui/handler/keyboard.ts:192

Disables the "keyboard pan/rotate" interaction, leaving the "keyboard zoom" interaction enabled.

Returns ​

void

Example ​

ts
map.keyboard.disableRotation();

enable() ​

enable(): void

Defined in: src/ui/handler/keyboard.ts:144

Enables the "keyboard rotate and zoom" interaction.

Returns ​

void

Example ​

ts
map.keyboard.enable();

Implementation of ​

Handler.enable


enableRotation() ​

enableRotation(): void

Defined in: src/ui/handler/keyboard.ts:205

Enables the "keyboard pan/rotate" interaction.

Returns ​

void

Example ​

ts
map.keyboard.enable();
map.keyboard.enableRotation();

isActive() ​

isActive(): boolean

Defined in: src/ui/handler/keyboard.ts:179

Returns true if the handler is enabled and has detected the start of a zoom/rotate gesture.

Returns ​

boolean

true if the handler is enabled and has detected the start of a zoom/rotate gesture.

Implementation of ​

Handler.isActive


isEnabled() ​

isEnabled(): boolean

Defined in: src/ui/handler/keyboard.ts:168

Returns a Boolean indicating whether the "keyboard rotate and zoom" interaction is enabled.

Returns ​

boolean

true if the "keyboard rotate and zoom" interaction is enabled.

Implementation of ​

Handler.isEnabled


reset() ​

reset(): void

Defined in: src/ui/handler/keyboard.ts:46

reset can be called by the manager at any time and must reset everything to it's original state

Returns ​

void

Implementation of ​

Handler.reset