Custom easing: any (t: number) => number function where t goes from 0 to 1.
Convenience methods
Method
Returns
Description
animatedZoom(factor?)
Promise<void>
Zoom in by factor (default: 1.5). Also accepts { factor?, duration?, easing? }
animatedUnzoom(factor?)
Promise<void>
Zoom out by factor (default: 1.5)
animatedReset(opts?)
Promise<void>
Animate to default state (x=0.5, y=0.5, angle=0, ratio=1)
isAnimated()
boolean
Check if an animation is currently running
Lifecycle
Method
Returns
Description
enable()
this
Enable camera updates
disable()
this
Disable all camera updates
copy()
Camera
Create an independent copy with the same state
Camera.from(state)
Camera
Static: create a new camera initialized to the given state
Interaction flags
Fine-grained flags toggle what kind of state updates the camera accepts. They are honored by validateState(), so both
direct setState calls and animations respect them.
Property
Type
Default
Description
enabledZooming
boolean
true
Accept ratio changes
enabledPanning
boolean
true
Accept x/y changes
enabledRotation
boolean
true
Accept angle changes
Custom state validation
Property
Type
Default
Description
clean
((state: CameraState) => CameraState) | null
null
Optional hook applied inside validateState(). Receives the merged next state and returns a possibly constrained replacement.
Bounds
Property
Type
Description
minRatio
number | null
Minimum zoom level (set via minCameraRatio setting)
maxRatio
number | null
Maximum zoom level (set via maxCameraRatio setting)