English中文

CallbackPositionProperty

new Cesium.CallbackPositionProperty(callback, isConstant, referenceFrame)

A PositionProperty 其值由回调函数延迟计算。 whose value is lazily evaluated by a callback function.
名称 Name 类型 Type 默认值 Default 说明 Description
callback CallbackPositionProperty.Callback 评估位置属性时要调用的函数。 The function to be called when the position property is evaluated.
isConstant boolean true 当回调函数每次返回相同的值时, when the callback function returns the same value every time, false 如果该值会改变。 if the value will change.
referenceFrame ReferenceFrame ReferenceFrame.FIXED 可选 optional 定义位置的参考系。 The reference frame in which the position is defined.
演示: Demo:

成员 Members

获取每当此属性的定义更改时引发的事件。如果对 getValue 的调用同时返回不同的结果,则认为定义已更改。 Gets the event that is raised whenever the definition of this property changes. The definition is considered to have changed if a call to getValue would return a different result for the same time.
获取一个值,该值指示该属性是否为常量。 Gets a value indicating if this property is constant.
获取定义位置的参考系。 Gets the reference frame in which the position is defined.
默认值: Default Value: ReferenceFrame.FIXED;

方法 Methods

将此属性与提供的属性进行比较并返回 Compares this property to the provided property and returns true 如果它们相等, if they are equal, false otherwise.
名称 Name 类型 Type 说明 Description
other Property 可选 optional 其他财产。 The other property.
返回: Returns:
true 如果左和右相等, if left and right are equal, false otherwise.
获取固定帧中给定时间的属性值。 Gets the value of the property at the provided time in the fixed frame.
名称 Name 类型 Type 默认值 Default 说明 Description
time JulianDate JulianDate.now() 可选 optional 检索值的时间。如果省略,则使用当前系统时间。 The time for which to retrieve the value. If omitted, the current system time is used.
result Cartesian3 可选 optional 用于存储值的对象,如果省略,则会创建并返回一个新实例。 The object to store the value into, if omitted, a new instance is created and returned.
返回: Returns:
修改后的结果参数或新实例(如果未提供结果参数)。 The modified result parameter or a new instance if the result parameter was not supplied.

getValueInReferenceFrame(time, referenceFrame, result)Cartesian3|undefined

获取属性在提供的时间和提供的参考系中的值。 Gets the value of the property at the provided time and in the provided reference frame.
名称 Name 类型 Type 说明 Description
time JulianDate 检索值的时间。 The time for which to retrieve the value.
referenceFrame ReferenceFrame 结果所需的参考框架。 The desired referenceFrame of the result.
result Cartesian3 可选 optional 用于存储值的对象,如果省略,则会创建并返回一个新实例。 The object to store the value into, if omitted, a new instance is created and returned.
返回: Returns:
修改后的结果参数或新实例(如果未提供结果参数)。 The modified result parameter or a new instance if the result parameter was not supplied.
设置要使用的回调。 Sets the callback to be used.
名称 Name 类型 Type 说明 Description
callback CallbackPositionProperty.Callback 评估属性时要调用的函数。 The function to be called when the property is evaluated.
isConstant boolean true 当回调函数每次返回相同的值时, when the callback function returns the same value every time, false 如果该值会改变。 if the value will change.

类型定义 Type Definitions

Cesium.CallbackPositionProperty.Callback(time, result)Cartesian3|undefined

返回位置属性值的函数。 A function that returns the value of the position property.
名称 Name 类型 Type 默认值 Default 说明 Description
time JulianDate JulianDate.now() 可选 optional 检索值的时间。如果省略,则使用当前系统时间。 The time for which to retrieve the value. If omitted, the current system time is used.
result Cartesian3 可选 optional 用于存储值的对象。如果省略,该函数必须创建并返回一个新实例。 The object to store the value into. If omitted, the function must create and return a new instance.
返回: Returns:
修改后的结果参数,如果未提供或不支持结果参数,则为新实例。 The modified result parameter, or a new instance if the result parameter was not supplied or is unsupported.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.