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

CooperativeGesturesHandler ​

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

A CooperativeGestureHandler is a control that adds cooperative gesture info when user tries to zoom in/out.

When the CooperativeGestureHandler blocks a gesture, it will emit a cooperativegestureprevented event.

Example ​

ts
const map = new Map({
  cooperativeGestures: true
});

See ​

Example: cooperative gestures

Implements ​

Methods ​

isActive() ​

isActive(): boolean

Defined in: src/ui/handler/cooperative_gestures.ts:42

This is used to indicate if the handler is currently active or not. In case a handler is active, it will block other handlers from getting the relevant events. There is an allow list of handlers that can be active at the same time, which is configured when adding a handler.

Returns ​

boolean

Implementation of ​

Handler.isActive


reset() ​

reset(): void

Defined in: src/ui/handler/cooperative_gestures.ts:45

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

Properties ​

_bypassKey ​

_bypassKey: "ctrlKey" | "metaKey"

Defined in: src/ui/handler/cooperative_gestures.ts:34

This is the key that will allow to bypass the cooperative gesture protection