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

1832 lines
71 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>TerrainProvider - 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>
TerrainProvider
<div class="titleCenterer"></div>
</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="nameContainer">
<h4 class="name" id="TerrainProvider">
<a href="#TerrainProvider" class="doc-link"></a>
new Cesium.TerrainProvider<span class="signature">()</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L19">Core/TerrainProvider.js 19</a>
</div>
</h4>
</div>
<div class="description">
Provides terrain or other geometry for the surface of an ellipsoid. The surface geometry is
organized into a pyramid of tiles according to a <a href="TilingScheme.html"><code>TilingScheme</code></a>. This type describes an
interface and is not intended to be instantiated directly.
</div>
<dl class="details">
<h5>See:</h5>
<ul class="see-list">
<li><a href="EllipsoidTerrainProvider.html">EllipsoidTerrainProvider</a></li>
<li><a href="CesiumTerrainProvider.html">CesiumTerrainProvider</a></li>
<li><a href="VRTheWorldTerrainProvider.html">VRTheWorldTerrainProvider</a></li>
<li><a href="GoogleEarthEnterpriseTerrainProvider.html">GoogleEarthEnterpriseTerrainProvider</a></li>
</ul>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<div class="nameContainer">
<h4 class="name" id=".heightmapTerrainQuality">
<a href="#.heightmapTerrainQuality" class="doc-link"></a>
<span class="type-signature attribute-static">static</span> Cesium.TerrainProvider.heightmapTerrainQuality<span class="type-signature"> : Number</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L377">Core/TerrainProvider.js 377</a>
</div>
</h4>
</div>
<div class="description">
Specifies the quality of terrain created from heightmaps. A value of 1.0 will
ensure that adjacent heightmap vertices are separated by no more than
<code>Globe.maximumScreenSpaceError</code> screen pixels and will probably go very slowly.
A value of 0.5 will cut the estimated level zero geometric error in half, allowing twice the
screen pixels between adjacent heightmap vertices and thus rendering more quickly.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="availability">
<a href="#availability" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> availability<span class="type-signature"> : <a href="TileAvailability.html">TileAvailability</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L112">Core/TerrainProvider.js 112</a>
</div>
</h4>
</div>
<div class="description">
Gets an object that can be used to determine availability of terrain from this provider, such as
at points and in rectangles. This function should not be called before
<a href="TerrainProvider.html#ready"><code>TerrainProvider#ready</code></a> returns true. This property may be undefined if availability
information is not available.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="credit">
<a href="#credit" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> credit<span class="type-signature"> : <a href="Credit.html">Credit</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L44">Core/TerrainProvider.js 44</a>
</div>
</h4>
</div>
<div class="description">
Gets the credit to display when this terrain provider is active. Typically this is used to credit
the source of the terrain. This function should
not be called before <a href="TerrainProvider.html#ready"><code>TerrainProvider#ready</code></a> returns true.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="errorEvent">
<a href="#errorEvent" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> errorEvent<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/Core/TerrainProvider.js#L32">Core/TerrainProvider.js 32</a>
</div>
</h4>
</div>
<div class="description">
Gets an event that is raised when the terrain provider encounters an asynchronous error.. By subscribing
to the event, you will be notified of the error and can potentially recover from it. Event listeners
are passed an instance of <a href="TileProviderError.html"><code>TileProviderError</code></a>.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="hasVertexNormals">
<a href="#hasVertexNormals" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> hasVertexNormals<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L99">Core/TerrainProvider.js 99</a>
</div>
</h4>
</div>
<div class="description">
Gets a value indicating whether or not the requested tiles include vertex normals.
This function should not be called before <a href="TerrainProvider.html#ready"><code>TerrainProvider#ready</code></a> returns true.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="hasWaterMask">
<a href="#hasWaterMask" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> hasWaterMask<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L88">Core/TerrainProvider.js 88</a>
</div>
</h4>
</div>
<div class="description">
Gets a value indicating whether or not the provider includes a water mask. The water mask
indicates which areas of the globe are water rather than land, so they can be rendered
as a reflective surface with animated waves. This function should not be
called before <a href="TerrainProvider.html#ready"><code>TerrainProvider#ready</code></a> returns true.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="ready">
<a href="#ready" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> ready<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L65">Core/TerrainProvider.js 65</a>
</div>
</h4>
</div>
<div class="description">
Gets a value indicating whether or not the provider is ready for use.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="readyPromise">
<a href="#readyPromise" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> readyPromise<span class="type-signature"> : Promise.&lt;Boolean></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L75">Core/TerrainProvider.js 75</a>
</div>
</h4>
</div>
<div class="description">
Gets a promise that resolves to true when the provider is ready for use.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="tilingScheme">
<a href="#tilingScheme" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> tilingScheme<span class="type-signature"> : <a href="TilingScheme.html">TilingScheme</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L55">Core/TerrainProvider.js 55</a>
</div>
</h4>
</div>
<div class="description">
Gets the tiling scheme used by the provider. This function should
not be called before <a href="TerrainProvider.html#ready"><code>TerrainProvider#ready</code></a> returns true.
</div>
<dl class="details">
</dl>
<h3 class="subsection-title">Methods</h3>
<div class="nameContainer">
<h4 class="name" id=".getEstimatedLevelZeroGeometricErrorForAHeightmap">
<a href="#.getEstimatedLevelZeroGeometricErrorForAHeightmap" class="doc-link"></a>
<span class="type-signature attribute-static">static</span> Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap<span class="signature">(ellipsoid, tileImageWidth, numberOfTilesAtLevelZero)</span> &rarr; <span class="type-signature returnType">Number</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L387">Core/TerrainProvider.js 387</a>
</div>
</h4>
</div>
<div class="description">
Determines an appropriate geometric error estimate when the geometry comes from a heightmap.
</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>ellipsoid</code></td>
<td class="type">
<span class="param-type"><a href="Ellipsoid.html">Ellipsoid</a></span>
</td>
<td class="description last">
The ellipsoid to which the terrain is attached.</td>
</tr>
<tr>
<td class="name"><code>tileImageWidth</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The width, in pixels, of the heightmap associated with a single tile.</td>
</tr>
<tr>
<td class="name"><code>numberOfTilesAtLevelZero</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The number of tiles in the horizontal direction at tile level zero.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
An estimated geometric error.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".getRegularGridIndices">
<a href="#.getRegularGridIndices" class="doc-link"></a>
<span class="type-signature attribute-static">static</span> Cesium.TerrainProvider.getRegularGridIndices<span class="signature">(width, height)</span> &rarr; <span class="type-signature returnType">Uint16Array|Uint32Array</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L129">Core/TerrainProvider.js 129</a>
</div>
</h4>
</div>
<div class="description">
Gets a list of indices for a triangle mesh representing a regular grid. Calling
this function multiple times with the same grid width and height returns the
same list of indices. The total number of vertices must be less than or equal
to 65536.
</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>width</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The number of vertices in the regular grid in the horizontal direction.</td>
</tr>
<tr>
<td class="name"><code>height</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The number of vertices in the regular grid in the vertical direction.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The list of indices. Uint16Array gets returned for 64KB or less and Uint32Array for 4GB or less.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="getLevelMaximumGeometricError">
<a href="#getLevelMaximumGeometricError" class="doc-link"></a>
getLevelMaximumGeometricError<span class="signature">(level)</span> &rarr; <span class="type-signature returnType">Number</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L427">Core/TerrainProvider.js 427</a>
</div>
</h4>
</div>
<div class="description">
Gets the maximum geometric error allowed in a tile at a given level. This function should not be
called before <a href="TerrainProvider.html#ready"><code>TerrainProvider#ready</code></a> returns true.
</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>level</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The tile level for which to get the maximum geometric error.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The maximum geometric error.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="getTileDataAvailable">
<a href="#getTileDataAvailable" class="doc-link"></a>
getTileDataAvailable<span class="signature">(x, y, level)</span> &rarr; <span class="type-signature returnType">Boolean|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L439">Core/TerrainProvider.js 439</a>
</div>
</h4>
</div>
<div class="description">
Determines whether data for a tile is available to be loaded.
</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>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The X coordinate of the tile for which to request geometry.</td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The Y coordinate of the tile for which to request geometry.</td>
</tr>
<tr>
<td class="name"><code>level</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The level of the tile for which to request geometry.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
Undefined if not supported by the terrain provider, otherwise true or false.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="loadTileDataAvailability">
<a href="#loadTileDataAvailability" class="doc-link"></a>
loadTileDataAvailability<span class="signature">(x, y, level)</span> &rarr; <span class="type-signature returnType">undefined|Promise.&lt;void></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L451">Core/TerrainProvider.js 451</a>
</div>
</h4>
</div>
<div class="description">
Makes sure we load availability data for a tile
</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>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The X coordinate of the tile for which to request geometry.</td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The Y coordinate of the tile for which to request geometry.</td>
</tr>
<tr>
<td class="name"><code>level</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The level of the tile for which to request geometry.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
Undefined if nothing need to be loaded or a Promise that resolves when all required tiles are loaded
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="requestTileGeometry">
<a href="#requestTileGeometry" class="doc-link"></a>
requestTileGeometry<span class="signature">(x, y, level, <span class="optional">request</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;<a href="TerrainData.html">TerrainData</a>>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/TerrainProvider.js#L416">Core/TerrainProvider.js 416</a>
</div>
</h4>
</div>
<div class="description">
Requests the geometry for a given tile. This function should not be called before
<a href="TerrainProvider.html#ready"><code>TerrainProvider#ready</code></a> returns true. The result must include terrain data and
may optionally include a water mask and an indication of which child tiles are available.
</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>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The X coordinate of the tile for which to request geometry.</td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The Y coordinate of the tile for which to request geometry.</td>
</tr>
<tr>
<td class="name"><code>level</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The level of the tile for which to request geometry.</td>
</tr>
<tr>
<td class="name"><code>request</code></td>
<td class="type">
<span class="param-type"><a href="Request.html">Request</a></span>
</td>
<td class="description last">
<span class="optional">optional</span>
The request object. Intended for internal use only.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
A promise for the requested geometry. If this method
returns undefined instead of a promise, it is an indication that too many requests are already
pending and the request will be retried later.
</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>