Skip to main content

flywave-mapview.cameramovementdetector

Home > @flywave/flywave-mapview > CameraMovementDetector

CameraMovementDetector class

The CameraMovementDetector class checks for changes in camera position and orientation, to detect continuous movements without the animation mode activated in MapView. If the interaction is not continuous enough, you can use a throttling timer to reduce the number of callbacks.

Signature:

export declare class CameraMovementDetector 

Constructors

Constructor

Modifiers

Description

(constructor)(m_throttlingTimeout, m_movementStartedFunc, m_movementFinishedFunc)

Initializes the detector with timeout value and callbacks. MapView also provides events for client code to be notified when these cues occur.

Properties

Property

Modifiers

Type

Description

cameraIsMoving

readonly

boolean

Returns true if the camera of this MapView is currently moving. In this case the m_movementFinishedFunc is waiting to be called after the throttling timer runs out.

cameraMovedLastFrame

readonly

boolean

Returns true if the camera has moved in the last frame.

Methods

Method

Modifiers

Description

checkCameraMoved(mapView, now)

Checks if the camera has moved since the last time it was checked. The m_movementStartedFunc is called when a movement starts. If no movement is detected, a timer for m_movementFinishedFunc starts.

clear(mapView)

Reset the saved camera position. Next time checkCameraMoved is called, it will return false.

dispose()

Disposes resources and kills the throttling timer.

forceMoved()

Force change of camera position. Next time checkCameraMoved is called, it will return true.