Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CameraMovementDetector

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.

Hierarchy

  • CameraMovementDetector

Index

Constructors

constructor

  • new CameraMovementDetector(m_throttlingTimeout: number | undefined, m_movementStartedFunc: (() => void) | undefined, m_movementFinishedFunc: (() => void) | undefined): CameraMovementDetector
  • Initializes the detector with timeout value and callbacks. MapView also provides events for client code to be notified when these cues occur.

    Parameters

    • m_throttlingTimeout: number | undefined

      The delay, in milliseconds, between the last user interaction detected and the call to m_movementFinishedFunc; the default is 300.

    • m_movementStartedFunc: (() => void) | undefined

      Callback function, called when the user starts interacting.

    • m_movementFinishedFunc: (() => void) | undefined

      Callback function, called when the user stops interacting.

    Returns CameraMovementDetector

Accessors

cameraIsMoving

  • get cameraIsMoving(): boolean

cameraMovedLastFrame

  • get cameraMovedLastFrame(): boolean

Methods

checkCameraMoved

  • checkCameraMoved(mapView: MapView, now: number): boolean
  • 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.

    Parameters

    • mapView: MapView

      [[Mapview]]'s position and camera are checked for modifications.

    • now: number

    Returns boolean

clear

dispose

  • dispose(): void

forceMoved

  • forceMoved(): void

Generated using TypeDoc