GestureViewer provides a way to subscribe to specific events from the viewer using the useGestureViewerEvent hook. This allows you to respond to real-time gesture changes like zoom and rotation.
You can listen to events on a specific instance by passing the instance ID as the first argument to the useGestureViewerEvent hook.
The default id value is default.
| Event Type | Description | Callback Data |
|---|---|---|
zoomChange | Fired when the zoom scale changes during pinch gestures | { scale: number, previousScale: number } |
rotationChange | Fired when the rotation angle changes during rotation gestures | { rotation: number, previousRotation: number } |