Class: ControllerPanZoom

ControllerPanZoom

ControllerPanZoom handles pan, zoom, and interaction events in a canvas element to manipulate camera parameters. It supports multiple interaction methods including:

  • Mouse drag for panning
  • Mouse wheel for zooming
  • Touch gestures (pinch to zoom)
  • Double tap to zoom

The controller maintains state for ongoing pan and zoom operations and can be configured to use different coordinate systems (HTML or GL) for calculations.


new ControllerPanZoom(camera [, options])

Creates a new ControllerPanZoom instance.

Parameters:
Name Type Argument Description
camera Camera

The camera object to control

options Object <optional>

Configuration options

Properties
Name Type Argument Default Description
zoomAmount number <optional>
1.2

The zoom multiplier for wheel/double-tap events

controlZoom boolean <optional>
false

If true, requires Ctrl key to be pressed for zoom operations

useGLcoords boolean <optional>
false

If true, uses WebGL coordinate system instead of HTML

panDelay number <optional>

Delay for pan animations

zoomDelay number <optional>

Delay for zoom animations

Source:
Fires:
  • ControllerPanZoom#event:nowheel - Emitted when a wheel event is received but ctrl key is required and not pressed

Extends

Methods


<abstract> fingerSingleTap(e)

Called for quick mouse press or short finger touch.

Parameters:
Name Type Description
e Event

The tap event

Inherited From:
Overrides:
Source:

modifierState(e)

Gets the modifier state from an event.

Parameters:
Name Type Description
e Event

The event to check

Inherited From:
Overrides:
Source:
Returns:

Modifier state bitmask where:

  • 0 = No modifiers
  • 1 = Ctrl key
  • 2 = Shift key
  • 4 = Alt key Multiple modifiers combine their values (e.g., Ctrl+Shift = 3)
Type
number