PropertyBag

new Cesium.PropertyBag(value, createPropertyCallback)

A Property whose value is a key-value mapping of property names to the computed value of other properties.
参数名称 类型 描述信息
value object 可选 An object, containing key-value mapping of property names to properties.
createPropertyCallback function 可选 A function that will be called when the value of any of the properties in value are not a Property.

成员(属性)

readonly definitionChanged : Event

Gets the event that is raised whenever the set of properties contained in this object changes, or one of the properties itself changes.

readonly isConstant : boolean

Gets a value indicating if this property is constant. This property is considered constant if all property items in this object are constant.
Gets the names of all properties registered on this instance.

方法

addProperty(propertyName, value, createPropertyCallback)

Adds a property to this object.
参数名称 类型 描述信息
propertyName string The name of the property to add.
value * 可选 The value of the new property, if provided.
createPropertyCallback function 可选 A function that will be called when the value of this new property is set to a value that is not a Property.
Throws:
Compares this property to the provided property and returns true if they are equal, false otherwise.
参数名称 类型 描述信息
other Property 可选 The other property.
返回值:
true if left and right are equal, false otherwise.

getValue(time, result)object

Gets the value of this property. Each contained property will be evaluated at the given time, and the overall result will be an object, mapping property names to those values.
参数名称 类型 默认值 描述信息
time JulianDate JulianDate.now() 可选 The time for which to retrieve the value. If omitted, the current system time is used.
result object 可选 The object to store the value into, if omitted, a new instance is created and returned. Note that any properties in result which are not part of this PropertyBag will be left as-is.
返回值:
The modified result parameter or a new instance if the result parameter was not supplied.

hasProperty(propertyName)boolean

Determines if this object has defined a property with the given name.
参数名称 类型 描述信息
propertyName string The name of the property to check for.
返回值:
True if this object has defined a property with the given name, false otherwise.

merge(source, createPropertyCallback)

Assigns each unassigned property on this object to the value of the same property on the provided source object.
参数名称 类型 描述信息
source object The object to be merged into this object.
createPropertyCallback function 可选 A function that will be called when the value of any of the properties in value are not a Property.

removeProperty(propertyName)

Removed a property previously added with addProperty.
参数名称 类型 描述信息
propertyName string The name of the property to remove.
Throws: