Skip to content

VistaImageEvent Class

The VistaImageEvent class manages pointer events and translates them into image manipulation actions like zooming, panning, and navigation.

VistaImageEvent coordinates:

  • Single and multi-touch gestures
  • Pinch-to-zoom detection
  • Pan/drag interactions when zoomed
  • Momentum scrolling
  • External pointer event listeners

Use Case: Created internally by VistaView. Extensions can register listeners through registerPointerListener().

None - all properties are private.

constructor(vvw: VistaView)

Creates a new event handling system for a VistaView instance.

registerPointerListener(listener: (e: VistaExternalPointerListenerArgs) => void): void

Registers an external pointer event listener. Same as calling viewer.registerPointerListener().

Parameters:

Example:

const eventSystem = new VistaImageEvent(viewer);
eventSystem.registerPointerListener((e) => {
console.log('Event:', e.event);
console.log('Pointers:', e.pointers.length);
console.log('State:', e.state.zoomedIn);
});
start(imageContainer: HTMLElement): void

Starts listening to pointer events on the specified container. Called automatically by VistaView when opening.

Parameters:

  • imageContainer - The element to attach event listeners to
stop(): void

Removes all event listeners and cleans up resources. Called automatically by VistaView when closing.

GitHubnpmllms.txtContext7

© 2026 • MIT License