# SelectionIndicatorViewModel

#### new Cesium.SelectionIndicatorViewModel(scene, selectionIndicatorElement, container)
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 23

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.

### Members

#### computeScreenSpacePosition : SelectionIndicatorViewModel.ComputeScreenSpacePosition
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 100

Gets or sets the function for converting the world position of the object to the screen space position.

Default Value: `SceneTransforms.worldToWindowCoordinates`

##### Example:

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

#### container : Element
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 177

Gets the HTML element containing the selection indicator.

#### isVisible : boolean
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 75

Gets the visibility of the position indicator. This can be false even if an object is selected, when the selected object has no position.

#### position : Cartesian3
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 54

Gets or sets the world position of the object for which to display the selection indicator.

#### scene : Scene
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 201

Gets the scene being used.

#### selectionIndicatorElement : Element
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 189

Gets the HTML element that holds the selection indicator.

#### showSelection : boolean
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 60

Gets or sets the visibility of the selection indicator.

### Methods

#### animateAppear()
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 145

Animate the indicator to draw attention to the selection.

#### animateDepart()
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 159

Animate the indicator to release the selection.

#### update()
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 109

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.

### Type Definitions

#### Cesium.SelectionIndicatorViewModel.ComputeScreenSpacePosition(position, result) → Cartesian2
widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js 208

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.

Need help? The fastest way to get answers is from the community and team on the Cesium Forum.