# CameraEventAggregator

#### new Cesium.CameraEventAggregator(element)
Scene/CameraEventAggregator.js 257

  Aggregates input events. For example, suppose the following inputs are received between frames: left mouse button down, mouse move, mouse move, left mouse button up. These events will be aggregated into one event with a start and end position of the mouse.

  Name | Type | Default | Description
  --- | --- | --- | ---
  `element` | Canvas | `document` | optional The element to handle events for.

  ##### See:

  - ScreenSpaceEventHandler

### Members

#### anyButtonDown : Boolean
Scene/CameraEventAggregator.js 317

  Gets whether any mouse button is down, a touch has started, or the wheel has been moved.

#### currentMousePosition : Cartesian2
Scene/CameraEventAggregator.js 306

  Gets the current mouse position.

### Methods

#### destroy() → undefined
Scene/CameraEventAggregator.js 506

  Removes mouse listeners held by this object.
  Once an object is destroyed, it should not be used; calling any function other than `isDestroyed` will result in a `DeveloperError` exception. Therefore, assign the return value (`undefined`) to the object as done in the example.

  ##### Returns:

  ##### Throws:

  - DeveloperError : This object was destroyed, i.e., destroy() was called.

  ##### Example:

      handler = handler && handler.destroy();

  ##### See:

  - CameraEventAggregator#isDestroyed

#### getButtonPressTime(type, modifier) → Date
Scene/CameraEventAggregator.js 435

  Gets the time the button was pressed or the touch was started.

  Name | Type | Description
  --- | --- | ---
  `type` | CameraEventType | The camera event type.
  `modifier` | KeyboardEventModifier | optional The keyboard modifier.

  ##### Returns:

  The time the button was pressed or the touch was started.

#### getButtonReleaseTime(type, modifier) → Date
Scene/CameraEventAggregator.js 453

  Gets the time the button was released or the touch was ended.

  Name | Type | Description
  --- | --- | ---
  `type` | CameraEventType | The camera event type.
  `modifier` | KeyboardEventModifier | optional The keyboard modifier.

  ##### Returns:

  The time the button was released or the touch was ended.

#### getLastMovement(type, modifier) → Object|undefined
Scene/CameraEventAggregator.js 372

  Gets the start and end position of the last move event (not the aggregated event).

  Name | Type | Description
  --- | --- | ---
  `type` | CameraEventType | The camera event type.
  `modifier` | KeyboardEventModifier | optional The keyboard modifier.

  ##### Returns:

  An object with two `Cartesian2` properties: `startPosition` and `endPosition` or `undefined`.

#### getMovement(type, modifier) → Object
Scene/CameraEventAggregator.js 353

  Gets the aggregated start and end position of the current event.

  Name | Type | Description
  --- | --- | ---
  `type` | CameraEventType | The camera event type.
  `modifier` | KeyboardEventModifier | optional The keyboard modifier.

  ##### Returns:

  An object with two `Cartesian2` properties: `startPosition` and `endPosition`.

#### getStartMousePosition(type, modifier) → Cartesian2
Scene/CameraEventAggregator.js 413

  Gets the mouse position that started the aggregation.

  Name | Type | Description
  --- | --- | ---
  `type` | CameraEventType | The camera event type.
  `modifier` | KeyboardEventModifier | optional The keyboard modifier.

  ##### Returns:

  The mouse position.

#### isButtonDown(type, modifier) → Boolean
Scene/CameraEventAggregator.js 395

  Gets whether the mouse button is down or a touch has started.

  Name | Type | Description
  --- | --- | ---
  `type` | CameraEventType | The camera event type.
  `modifier` | KeyboardEventModifier | optional The keyboard modifier.

  ##### Returns:

  Whether the mouse button is down or a touch has started.

#### isDestroyed() → Boolean
Scene/CameraEventAggregator.js 485

  Returns true if this object was destroyed; otherwise, false.
  If this object was destroyed, it should not be used; calling any function other than `isDestroyed` will result in a `DeveloperError` exception.

  ##### Returns:

  `true` if this object was destroyed; otherwise, `false`.

  ##### See:

  - CameraEventAggregator#destroy

#### isMoving(type, modifier) → Boolean
Scene/CameraEventAggregator.js 335

  Gets if a mouse button down or touch has started and has been moved.

  Name | Type | Description
  --- | --- | ---
  `type` | CameraEventType | The camera event type.
  `modifier` | KeyboardEventModifier | optional The keyboard modifier.

  ##### Returns:

  Returns `true` if a mouse button down or touch has started and has been moved; otherwise, `false`

#### reset()
Scene/CameraEventAggregator.js 467

  Signals that all of the events have been handled and the aggregator should be reset to handle new events.