视图模型为 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 | 包含小部件的 DOM 元素。 The DOM element that contains the widget. |
成员 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.worldToWindowCoordinates
示例: Example:
selectionIndicatorViewModel.computeScreenSpacePosition = function(position, result) {
return Cesium.SceneTransforms.worldToWindowCoordinates(scene, position, result);
};
获取包含选择指示符的 HTML 元素。 Gets the HTML element containing the selection indicator.
获取位置指示器的可见性。当所选对象没有位置时,即使选择了对象,该值也可能为 false。 Gets the visibility of the position indicator. This can be false even if an object is selected, when the selected object has no position.
获取或设置要显示选择指示器的对象的世界位置。 Gets or sets the world position of the object for which to display the selection indicator.
获取正在使用的场景。 Gets the scene being used.
获取包含选择指示器的 HTML 元素。 Gets the HTML element that holds the selection indicator.
获取或设置选择指示器的可见性。 Gets or sets the visibility of the selection indicator.
方法 Methods
对指示器进行动画处理以引起对选择的注意。 Animate the indicator to draw attention to the selection.
动画指示器以释放选择。 Animate the indicator to release the selection.
更新选择指示器的视图以匹配视图模型的位置和内容属性。该函数应该作为渲染循环的一部分来调用。 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
将对象的世界位置转换为屏幕空间位置的函数。 A function that converts the world position of an object to a screen space position.
| 名称 Name | 类型 Type | 说明 Description |
|---|---|---|
position |
Cartesian3 | WGS84(世界)坐标中的位置。 The position in WGS84 (world) coordinates. |
result |
Cartesian2 | 返回转换为窗口坐标的输入位置的对象。 An object to return the input position transformed to window coordinates. |
返回: Returns:
修改后的结果参数。 The modified result parameter.
