SelectionIndicatorViewModel - Cesium Documentation

# SelectionIndicatorViewModel

#### new SelectionIndicatorViewModel(scene, selectionIndicatorElement, container)

  The view model for `SelectionIndicator`.

  Name | Type | Description
  --- | --- | ---
  `scene` | Scene | The scene instance to use for screen-space coordinate conversion.
  `selectionIndicatorElement` | Element | The element containing all elements that make up the selection indicator.
  `container` | Element | The DOM element that contains the widget.

  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 34

### Members

#### computeScreenSpacePosition :SelectionIndicatorViewModel~ComputeScreenSpacePosition

  Gets or sets the function for converting the world position of the object to the screen space position.
  Default Value: `SceneTransforms.wgs84ToWindowCoordinates`

  ##### Example:

      selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
          return Cesium.SceneTransforms.wgs84ToWindowCoordinates(scene, position, result);
      };

  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 101

#### container :Element

  Gets the HTML element containing the selection indicator.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 167

#### isVisible :Boolean

  Gets the visibility of the position indicator. This can be false even if an object is selected, when the selected object has no position.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 76

#### position :Cartesian3

  Gets or sets the world position of the object for which to display the selection indicator.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 61

#### scene :Scene

  Gets the scene being used.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 191

#### selectionIndicatorElement :Element

  Gets the HTML element that holds the selection indicator.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 179

#### showSelection :Boolean

  Gets or sets the visibility of the selection indicator.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 67

### Methods

#### animateAppear()

  Animate the indicator to draw attention to the selection.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 135

#### animateDepart()

  Animate the indicator to release the selection.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 149

#### update()

  Updates the view of the selection indicator to match the position and content properties of the view model. This function should be called as part of the render loop.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 110

### Type Definitions

#### ComputeScreenSpacePosition(position, result) → Cartesian2

  A function that converts the world position of an object to a screen space position.

  Name | Type | Description
  --- | --- | ---
  `position` | Cartesian3 | The position in WGS84 (world) coordinates.
  `result` | Cartesian2 | An object to return the input position transformed to window coordinates.

  ##### Returns:

  The modified result parameter.
  Source: Widgets/SelectionIndicator/SelectionIndicatorViewModel.js, line 198