qd-changjing/public/static/Build/Documentation/EntityCollection.html

1933 lines
70 KiB
HTML
Raw Normal View History

2022-07-05 16:56:29 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>EntityCollection - Cesium Documentation</title>
<!--[if lt IE 9]>
<script src="javascript/html5.js"></script>
<![endif]-->
<link href="styles/jsdoc-default.css" rel="stylesheet">
<link href="styles/prism.css" rel="stylesheet">
</head>
<body>
<div id="main">
<h1 class="page-title">
<a href="index.html"><img src="Images/CesiumLogo.png" class="cesiumLogo"></a>
EntityCollection
<div class="titleCenterer"></div>
</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="nameContainer">
<h4 class="name" id="EntityCollection">
<a href="#EntityCollection" class="doc-link"></a>
new Cesium.EntityCollection<span class="signature">(<span class="optional">owner</span>)</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L56">DataSources/EntityCollection.js 56</a>
</div>
</h4>
</div>
<div class="description">
An observable collection of <a href="Entity.html"><code>Entity</code></a> instances where each entity has a unique id.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>owner</code></td>
<td class="type">
<span class="param-type"><a href="DataSource.html">DataSource</a></span>
|
<span class="param-type"><a href="CompositeEntityCollection.html">CompositeEntityCollection</a></span>
</td>
<td class="description last">
<span class="optional">optional</span>
The data source (or composite entity collection) which created this collection.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<div class="nameContainer">
<h4 class="name" id="collectionChanged">
<a href="#collectionChanged" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> collectionChanged<span class="type-signature"> : <a href="Event.html">Event</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L123">DataSources/EntityCollection.js 123</a>
</div>
</h4>
</div>
<div class="description">
Gets the event that is fired when entities are added or removed from the collection.
The generated event is a <a href="EntityCollection.html#.collectionChangedEventCallback"><code>EntityCollection.collectionChangedEventCallback</code></a>.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="id">
<a href="#id" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> id<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L134">DataSources/EntityCollection.js 134</a>
</div>
</h4>
</div>
<div class="description">
Gets a globally unique identifier for this collection.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="owner">
<a href="#owner" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> owner<span class="type-signature"> : <a href="DataSource.html">DataSource</a>|<a href="CompositeEntityCollection.html">CompositeEntityCollection</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L212">DataSources/EntityCollection.js 212</a>
</div>
</h4>
</div>
<div class="description">
Gets the owner of this entity collection, ie. the data source or composite entity collection which created it.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="show">
<a href="#show" class="doc-link"></a>
show<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L158">DataSources/EntityCollection.js 158</a>
</div>
</h4>
</div>
<div class="description">
Gets whether or not this entity collection should be
displayed. When true, each entity is only displayed if
its own show property is also true.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="values">
<a href="#values" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> values<span class="type-signature"> : Array.&lt;<a href="Entity.html">Entity</a>></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L146">DataSources/EntityCollection.js 146</a>
</div>
</h4>
</div>
<div class="description">
Gets the array of Entity instances in the collection.
This array should not be modified directly.
</div>
<dl class="details">
</dl>
<h3 class="subsection-title">Methods</h3>
<div class="nameContainer">
<h4 class="name" id=".collectionChangedEventCallback">
<a href="#.collectionChangedEventCallback" class="doc-link"></a>
<span class="type-signature attribute-static">static</span> Cesium.EntityCollection.collectionChangedEventCallback<span class="signature">(collection, added, removed, changed)</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L113">DataSources/EntityCollection.js 113</a>
</div>
</h4>
</div>
<div class="description">
The signature of the event generated by <a href="EntityCollection.html#collectionChanged"><code>EntityCollection#collectionChanged</code></a>.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>collection</code></td>
<td class="type">
<span class="param-type"><a href="EntityCollection.html">EntityCollection</a></span>
</td>
<td class="description last">
The collection that triggered the event.</td>
</tr>
<tr>
<td class="name"><code>added</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="Entity.html">Entity</a>></span>
</td>
<td class="description last">
The array of <a href="Entity.html"><code>Entity</code></a> instances that have been added to the collection.</td>
</tr>
<tr>
<td class="name"><code>removed</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="Entity.html">Entity</a>></span>
</td>
<td class="description last">
The array of <a href="Entity.html"><code>Entity</code></a> instances that have been removed from the collection.</td>
</tr>
<tr>
<td class="name"><code>changed</code></td>
<td class="type">
<span class="param-type">Array.&lt;<a href="Entity.html">Entity</a>></span>
</td>
<td class="description last">
The array of <a href="Entity.html"><code>Entity</code></a> instances that have been modified.</td>
</tr>
</tbody>
</table>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="add">
<a href="#add" class="doc-link"></a>
add<span class="signature">(entity)</span> &rarr; <span class="type-signature returnType"><a href="Entity.html">Entity</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L271">DataSources/EntityCollection.js 271</a>
</div>
</h4>
</div>
<div class="description">
Add an entity to the collection.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>entity</code></td>
<td class="type">
<span class="param-type"><a href="Entity.html">Entity</a></span>
|
<span class="param-type"><a href="Entity.html#.ConstructorOptions">Entity.ConstructorOptions</a></span>
</td>
<td class="description last">
The entity to be added.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The entity that was added.
</div>
<h5>Throws:</h5>
<ul>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: An entity with <entity.id> already exists in this collection.
</div>
</li>
</ul>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="computeAvailability">
<a href="#computeAvailability" class="doc-link"></a>
computeAvailability<span class="signature">()</span> &rarr; <span class="type-signature returnType"><a href="TimeInterval.html">TimeInterval</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L227">DataSources/EntityCollection.js 227</a>
</div>
</h4>
</div>
<div class="description">
Computes the maximum availability of the entities in the collection.
If the collection contains a mix of infinitely available data and non-infinite data,
it will return the interval pertaining to the non-infinite data only. If all
data is infinite, an infinite interval will be returned.
</div>
<h5>Returns:</h5>
<div class="param-desc">
The availability of entities in the collection.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="contains">
<a href="#contains" class="doc-link"></a>
contains<span class="signature">(entity)</span> &rarr; <span class="type-signature returnType">Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L324">DataSources/EntityCollection.js 324</a>
</div>
</h4>
</div>
<div class="description">
Returns true if the provided entity is in this collection, false otherwise.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>entity</code></td>
<td class="type">
<span class="param-type"><a href="Entity.html">Entity</a></span>
</td>
<td class="description last">
The entity.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
true if the provided entity is in this collection, false otherwise.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="getById">
<a href="#getById" class="doc-link"></a>
getById<span class="signature">(id)</span> &rarr; <span class="type-signature returnType"><a href="Entity.html">Entity</a>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L402">DataSources/EntityCollection.js 402</a>
</div>
</h4>
</div>
<div class="description">
Gets an entity with the specified id.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
The id of the entity to retrieve.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The entity with the provided id or undefined if the id did not exist in the collection.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="getOrCreateEntity">
<a href="#getOrCreateEntity" class="doc-link"></a>
getOrCreateEntity<span class="signature">(id)</span> &rarr; <span class="type-signature returnType"><a href="Entity.html">Entity</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L418">DataSources/EntityCollection.js 418</a>
</div>
</h4>
</div>
<div class="description">
Gets an entity with the specified id or creates it and adds it to the collection if it does not exist.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
The id of the entity to retrieve or create.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The new or existing object.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="remove">
<a href="#remove" class="doc-link"></a>
remove<span class="signature">(entity)</span> &rarr; <span class="type-signature returnType">Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L311">DataSources/EntityCollection.js 311</a>
</div>
</h4>
</div>
<div class="description">
Removes an entity from the collection.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>entity</code></td>
<td class="type">
<span class="param-type"><a href="Entity.html">Entity</a></span>
</td>
<td class="description last">
The entity to be removed.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
true if the item was removed, false if it did not exist in the collection.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="removeAll">
<a href="#removeAll" class="doc-link"></a>
removeAll<span class="signature">()</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L367">DataSources/EntityCollection.js 367</a>
</div>
</h4>
</div>
<div class="description">
Removes all Entities from the collection.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="removeById">
<a href="#removeById" class="doc-link"></a>
removeById<span class="signature">(id)</span> &rarr; <span class="type-signature returnType">Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L339">DataSources/EntityCollection.js 339</a>
</div>
</h4>
</div>
<div class="description">
Removes an entity with the provided id from the collection.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>id</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
The id of the entity to remove.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
true if the item was removed, false if no item with the provided id existed in the collection.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="resumeEvents">
<a href="#resumeEvents" class="doc-link"></a>
resumeEvents<span class="signature">()</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L91">DataSources/EntityCollection.js 91</a>
</div>
</h4>
</div>
<div class="description">
Resumes raising <a href="EntityCollection.html#collectionChanged"><code>EntityCollection#collectionChanged</code></a> events immediately
when an item is added or removed. Any modifications made while while events were suspended
will be triggered as a single event when this function is called.
This function is reference counted and can safely be called multiple times as long as there
are corresponding calls to <a href="EntityCollection.html#resumeEvents"><code>EntityCollection#resumeEvents</code></a>.
</div>
<h5>Throws:</h5>
<ul>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: resumeEvents can not be called before suspendEvents.
</div>
</li>
</ul>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="suspendEvents">
<a href="#suspendEvents" class="doc-link"></a>
suspendEvents<span class="signature">()</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/DataSources/EntityCollection.js#L78">DataSources/EntityCollection.js 78</a>
</div>
</h4>
</div>
<div class="description">
Prevents <a href="EntityCollection.html#collectionChanged"><code>EntityCollection#collectionChanged</code></a> events from being raised
until a corresponding call is made to <a href="EntityCollection.html#resumeEvents"><code>EntityCollection#resumeEvents</code></a>, at which
point a single event will be raised that covers all suspended operations.
This allows for many items to be added and removed efficiently.
This function can be safely called multiple times as long as there
are corresponding calls to <a href="EntityCollection.html#resumeEvents"><code>EntityCollection#resumeEvents</code></a>.
</div>
<dl class="details">
</dl>
</article>
</section>
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a>
</footer>
</div>
<div class="nav">
<div class="menu">
<input type="text" class="classFilter" id="ClassFilter" placeholder="Search">
<ul id="ClassList"><li data-name="Animation"><a href="Animation.html">Animation</a></li><li data-name="AnimationViewModel"><a href="AnimationViewModel.html">AnimationViewModel</a></li><li data-name="Appearance"><a href="Appearance.html">Appearance</a></li><li data-name="ArcGisMapServerImageryProvider"><a href="ArcGisMapServerImageryProvider.html">ArcGisMapServerImageryProvider</a></li><li data-name="ArcGISTiledElevationTerrainProvider"><a href="ArcGISTiledElevationTerrainProvider.html">ArcGISTiledElevationTerrainProvider</a></li><li data-name="ArcType"><a href="global.html#ArcType">ArcType</a></li><li data-name="AssociativeArray"><a href="AssociativeArray.html">AssociativeArray</a></li><li data-name="Axis"><a href="global.html#Axis">Axis</a></li><li data-name="AxisAlignedBoundingBox"><a href="AxisAlignedBoundingBox.html">AxisAlignedBoundingBox</a></li><li data-name="backFaceCulling"><a href="global.html#backFaceCulling">backFaceCulling</a></li><li data-name="barycentricCoordinates"><a href="global.html#barycentricCoordinates">barycentricCoordinates</a></li><li data-name="BaseLayerPicker"><a href="BaseLayerPicker.html">BaseLayerPicker</a></li><li data-name="BaseLayerPickerViewModel"><a href="BaseLayerPickerViewModel.html">BaseLayerPickerViewModel</a></li><li data-name="Billboard"><a href="Billboard.html">Billboard</a></li><li data-name="BillboardCollection"><a href="BillboardCollection.html">BillboardCollection</a></li><li data-name="BillboardGraphics"><a href="BillboardGraphics.html">BillboardGraphics</a></li><li data-name="BillboardVisualizer"><a href="BillboardVisualizer.html">BillboardVisualizer</a></li><li data-name="binarySearch"><a href="global.html#binarySearch">binarySearch</a></li><li data-name="binarySearchComparator"><a href="global.html#binarySearchComparator">binarySearchComparator</a></li><li data-name="BingMapsGeocoderService"><a href="BingMapsGeocoderService.html">BingMapsGeocoderService</a></li><li data-name="BingMapsImageryProvider"><a href="BingMapsImageryProvider.html">BingMapsImageryProvider</a></li><li data-name="BingMapsStyle"><a href="global.html#BingMapsStyle">BingMapsStyle</a></li><li data-name="BlendEquation"><a href="global.html#BlendEquation">BlendEquation</a></li><li data-name="BlendFunction"><a href="global.html#BlendFunction">BlendFunction</a></li><li data-name="BlendingState"><a href="BlendingState.html">BlendingState</a></li><li data-name="BlendOption"><a href="global.html#BlendOption">BlendOption</a></li><li data-name="BoundingRectangle"><a href="BoundingRectangle.html">BoundingRectangle</a></li><li data-name="BoundingSphere"><a href="BoundingSphere.html">BoundingSphere</a></li><li data-name="boundingSphere"><a href="global.html#boundingSphere">boundingSphere</a></li><li data-name="BoxEmitter"><a href="BoxEmitter.html">BoxEmitter</a></li><li data-name="BoxGeometry"><a href="BoxGeometry.html">BoxGeometry</a></li><li data-name="BoxGeometryUpdater"><a href="BoxGeometryUpdater.html">BoxGeometryUpdater</a></li><li data-name="BoxGraphics"><a href="BoxGraphics.html">BoxGraphics</a></li><li data-name="BoxOutlineGeometry"><a href="BoxOutlineGeometry.html">BoxOutlineGeometry</a></li><li data-name="buildModuleUrl"><a href="global.html#buildModuleUrl">buildModuleUrl</a></li><li data-name="CallbackProperty"><a href="CallbackProperty.html">CallbackProperty</a></li><li data-name="Camera"><a href="Camera.html">Camera</a></li><li data-name="CameraEventAggregator"><a href="CameraEventAggregator.html">CameraEventAggregator</a></li><li data-name="CameraEventType"><a href="global.html#CameraEventType">CameraEventType</a></li><li data-name="cancelAnimationFrame"><a href="global.html#cancelAnimationFrame">cancelAnimationFrame</a></li><li data-name="Cartesian2"><a href="Cartesian2.html">Cartesian2</a></li><li data-name="Cartesian3"><a href="Cartesian3.html">Cartesian3</a></li><li data-name="Cartesian4"><a href="Cartesian4.html">Cartesian4</a></li><li data-name="Cartographic"><a href="Cartographic.html">Cartographic</a></li><li data-name="CartographicGeocoderService"><a href="CartographicGeocoderServic
</div>
</div>
<script>
if (window.frameElement) {
document.body.className = 'embedded';
var ele = document.createElement('a');
ele.className = 'popout';
ele.target = '_blank';
ele.href = window.location.href;
ele.title = 'Pop out';
document.getElementById('main').appendChild(ele);
}
// Set targets on external links. Sandcastle and GitHub shouldn't be embedded in any iframe.
Array.prototype.forEach.call(document.getElementsByTagName('a'), function(a) {
if (/^https?:/i.test(a.getAttribute('href'))) {
a.target='_blank';
}
});
</script>
<script src="javascript/prism.js"></script>
<script src="javascript/cesiumDoc.js"></script>
</body>
</html>