English中文

AssociativeArray

new Cesium.AssociativeArray()

键值对的集合,存储为散列以便于查找,但也提供了用于快速迭代的数组。 A collection of key-value pairs that is stored as a hash for easy lookup but also provides an array for fast iteration.

成员 Members

获取集合中的项目数。 Gets the number of items in the collection.
获取集合中所有值的无序数组。这是一个实时数组,将自动反映集合中的值,不应直接修改它。 Gets an unordered array of all values in the collection. This is a live array that will automatically reflect the values in the collection, it should not be modified directly.

方法 Methods

contains(key)boolean

确定提供的键是否在数组中。 Determines if the provided key is in the array.
名称 Name 类型 Type 说明 Description
key string | number 关键要检查。 The key to check.
返回: Returns:
true 如果键在数组中, if the key is in the array, false otherwise.
检索与提供的键关联的值。 Retrieves the value associated with the provided key.
名称 Name 类型 Type 说明 Description
key string | number 要检索其值的键。 The key whose value is to be retrieved.
返回: Returns:
关联值,如果集合中不存在该键,则为未定义。 The associated value, or undefined if the key does not exist in the collection.
从集合中删除键值对。 Removes a key-value pair from the collection.
名称 Name 类型 Type 说明 Description
key string | number 要移除的密钥。 The key to be removed.
返回: Returns:
如果已删除,则为 true;如果密钥不在集合中,则为 false。 True if it was removed, false if the key was not in the collection.
清除集合。 Clears the collection.
将提供的键与提供的值相关联。如果该键已经存在,则会用新值覆盖它。 Associates the provided key with the provided value. If the key already exists, it is overwritten with the new value.
名称 Name 类型 Type 说明 Description
key string | number 唯一标识符。 A unique identifier.
value * 与提供的键关联的值。 The value to associate with the provided key.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.