Class: Camera
Camera class
Extends
TypedEventEmitter
<CameraEvents
>
Implements
CameraState
Constructors
new Camera()
new Camera():
Camera
Returns
Overrides
TypedEventEmitter<CameraEvents>.constructor
Defined in
Properties
angle
angle:
number
=0
Implementation of
CameraState.angle
Defined in
animationCallback()?
optional
animationCallback: () =>void
Returns
void
Defined in
clean
clean:
null
| (state
) =>CameraState
=null
Defined in
enabledPanning
enabledPanning:
boolean
=true
Defined in
enabledRotation
enabledRotation:
boolean
=true
Defined in
enabledZooming
enabledZooming:
boolean
=true
Defined in
maxRatio
maxRatio:
null
|number
=null
Defined in
minRatio
minRatio:
null
|number
=null
Defined in
ratio
ratio:
number
=1
Implementation of
CameraState.ratio
Defined in
rawEmitter
rawEmitter:
EventEmitter
<DefaultEventMap
>
Inherited from
TypedEventEmitter.rawEmitter
Defined in
x
x:
number
=0.5
Implementation of
CameraState.x
Defined in
y
y:
number
=0.5
Implementation of
CameraState.y
Defined in
Methods
addListener()
addListener<
Event
>(type
,listener
):this
Type Parameters
• Event extends "updated"
Parameters
• type: Event
• listener: CameraEvents
[Event
]
Returns
this
Inherited from
TypedEventEmitter.addListener
Defined in
animate()
animate(state, opts, callback)
animate(
state
,opts
,callback
):void
Method used to animate the camera.
Parameters
• state: Partial
<CameraState
>
• opts: Partial
<AnimateOptions
>
• callback
Returns
void
Defined in
animate(state, opts)
animate(
state
,opts
?):Promise
<void
>
Parameters
• state: Partial
<CameraState
>
• opts?: Partial
<AnimateOptions
>
Returns
Promise
<void
>
Defined in
animatedReset()
animatedReset(
options
?):Promise
<void
>
Method used to reset the camera.
Parameters
• options?: Partial
<AnimateOptions
>
Returns
Promise
<void
>
Defined in
animatedUnzoom()
animatedUnzoom(
factorOrOptions
?):Promise
<void
>
Method used to unzoom the camera.
Parameters
• factorOrOptions?: number
| Partial
<AnimateOptions
> & object
Returns
Promise
<void
>
Defined in
animatedZoom()
animatedZoom(
factorOrOptions
?):Promise
<void
>
Method used to zoom the camera.
Parameters
• factorOrOptions?: number
| Partial
<AnimateOptions
> & object
Returns
Promise
<void
>
Defined in
copy()
copy():
Camera
Returns a new Camera instance, with the same state as the current camera.
Returns
Defined in
disable()
disable():
this
Method used to disable the camera.
Returns
this
Defined in
emit()
emit<
Event
>(type
, ...args
):boolean
Type Parameters
• Event extends "updated"
Parameters
• type: Event
• ...args: Parameters
<CameraEvents
[Event
]>
Returns
boolean
Inherited from
TypedEventEmitter.emit
Defined in
enable()
enable():
this
Method used to enable the camera.
Returns
this
Defined in
eventNames()
eventNames<
Event
>():Event
[]
Type Parameters
• Event extends "updated"
Returns
Event
[]
Inherited from
TypedEventEmitter.eventNames
Defined in
getBoundedRatio()
getBoundedRatio(
ratio
):number
Method used to check minRatio and maxRatio values.
Parameters
• ratio: number
Returns
number
Defined in
getMaxListeners()
getMaxListeners():
number
Returns
number
Inherited from
TypedEventEmitter.getMaxListeners
Defined in
getPreviousState()
getPreviousState():
null
|CameraState
Method used to retrieve the camera's previous state.
Returns
null
| CameraState
Defined in
getState()
getState():
CameraState
Method used to retrieve the camera's current state.
Returns
CameraState
Defined in
hasState()
hasState(
state
):boolean
Method used to check whether the camera has the given state.
Parameters
• state: CameraState
Returns
boolean
Defined in
isAnimated()
isAnimated():
boolean
Method used to check whether the camera is currently being animated.
Returns
boolean
Defined in
listenerCount()
listenerCount<
Event
>(type
):number
Type Parameters
• Event extends "updated"
Parameters
• type: Event
Returns
number
Inherited from
TypedEventEmitter.listenerCount
Defined in
listeners()
listeners<
Event
>(type
):CameraEvents
[Event
][]
Type Parameters
• Event extends "updated"
Parameters
• type: Event
Returns
CameraEvents
[Event
][]
Inherited from
TypedEventEmitter.listeners
Defined in
off()
off<
Event
>(type
,listener
):this
Type Parameters
• Event extends "updated"
Parameters
• type: Event
• listener: CameraEvents
[Event
]
Returns
this
Inherited from
TypedEventEmitter.off
Defined in
on()
on<
Event
>(type
,listener
):this
Type Parameters
• Event extends "updated"
Parameters
• type: Event
• listener: CameraEvents
[Event
]
Returns
this
Inherited from
TypedEventEmitter.on
Defined in
once()
once<
Event
>(type
,listener
):this
Type Parameters
• Event extends "updated"
Parameters
• type: Event
• listener: CameraEvents
[Event
]
Returns
this
Inherited from
TypedEventEmitter.once
Defined in
prependListener()
prependListener<
Event
>(type
,listener
):this
Type Parameters
• Event extends "updated"
Parameters
• type: Event
• listener: CameraEvents
[Event
]
Returns
this
Inherited from
TypedEventEmitter.prependListener
Defined in
prependOnceListener()
prependOnceListener<
Event
>(type
,listener
):this
Type Parameters
• Event extends "updated"
Parameters
• type: Event
• listener: CameraEvents
[Event
]
Returns
this
Inherited from
TypedEventEmitter.prependOnceListener
Defined in
rawListeners()
rawListeners<
Event
>(type
):CameraEvents
[Event
][]
Type Parameters
• Event extends "updated"
Parameters
• type: Event
Returns
CameraEvents
[Event
][]
Inherited from
TypedEventEmitter.rawListeners
Defined in
removeAllListeners()
removeAllListeners<
Event
>(type
?):this
Type Parameters
• Event extends "updated"
Parameters
• type?: Event
Returns
this
Inherited from
TypedEventEmitter.removeAllListeners
Defined in
removeListener()
removeListener<
Event
>(type
,listener
):this
Type Parameters
• Event extends "updated"
Parameters
• type: Event
• listener: CameraEvents
[Event
]
Returns
this
Inherited from
TypedEventEmitter.removeListener
Defined in
setMaxListeners()
setMaxListeners(
n
):this
Parameters
• n: number
Returns
this
Inherited from
TypedEventEmitter.setMaxListeners
Defined in
setState()
setState(
state
):this
Method used to set the camera's state.
Parameters
• state: Partial
<CameraState
>
Returns
this
Defined in
updateState()
updateState(
updater
):this
Method used to update the camera's state using a function.
Parameters
• updater
Returns
this
Defined in
validateState()
validateState(
state
):Partial
<CameraState
>
Method used to check various things to return a legit state candidate.
Parameters
• state: Partial
<CameraState
>
Returns
Partial
<CameraState
>
Defined in
from()
static
from(state
):Camera
Static method used to create a Camera object with a given state.
Parameters
• state: CameraState