# PropertyBag

#### new Cesium.PropertyBag(value, createPropertyCallback)
engine/Source/DataSources/PropertyBag.js 19

A `Property` whose value is a key-value mapping of property names to the computed value of other properties.

Name | Type | Description
--- | --- | ---
`value` | object | optional An object, containing key-value mapping of property names to properties.
`createPropertyCallback` | function | optional A function that will be called when the value of any of the properties in value are not a Property.

### Members

#### readonly definitionChanged : Event
engine/Source/DataSources/PropertyBag.js 67

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
engine/Source/DataSources/PropertyBag.js 47

Gets a value indicating if this property is constant. This property is considered constant if all property items in this object are constant.

#### propertyNames : Array
engine/Source/DataSources/PropertyBag.js 34

Gets the names of all properties registered on this instance.

### Methods

#### addProperty(propertyName, value, createPropertyCallback)
engine/Source/DataSources/PropertyBag.js 98

Adds a property to this object.

Name | Type | Description
--- | --- | ---
`propertyName` | string | The name of the property to add.
`value` | * | optional The value of the new property, if provided.
`createPropertyCallback` | function | optional A function that will be called when the value of this new property is set to a value that is not a Property.

##### Throws:

- DeveloperError : "propertyName" is already a registered property.

#### equals(other) → boolean
engine/Source/DataSources/PropertyBag.js 268

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.

#### getValue(time, result) → object
engine/Source/DataSources/PropertyBag.js 169

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.

Name | Type | Description
--- | --- | ---
`time` | JulianDate | The time for which to retrieve the value.
`result` | object | optional 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.

##### Returns:

The modified result parameter or a new instance if the result parameter was not supplied.

#### hasProperty(propertyName) → boolean
engine/Source/DataSources/PropertyBag.js 81

Determines if this object has defined a property with the given name.

Name | Type | Description
--- | --- | ---
`propertyName` | string | The name of the property to check for.

##### Returns:

True if this object has defined a property with the given name, false otherwise.

#### merge(source, createPropertyCallback)
engine/Source/DataSources/PropertyBag.js 199

Assigns each unassigned property on this object to the value of the same property on the provided source object.

Name | Type | Description
--- | --- | ---
`source` | object | The object to be merged into this object.
`createPropertyCallback` | function | optional A function that will be called when the value of any of the properties in value are not a Property.

#### removeProperty(propertyName)
engine/Source/DataSources/PropertyBag.js 141

Removed a property previously added with addProperty.

Name | Type | Description
--- | --- | ---
`propertyName` | string | The name of the property to remove.

##### Throws:

- DeveloperError : "propertyName" is not a registered property.

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