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

6274 lines
141 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>IonResource - 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>
IonResource
<div class="titleCenterer"></div>
</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="nameContainer">
<h4 class="name" id="IonResource">
<a href="#IonResource" class="doc-link"></a>
new Cesium.IonResource<span class="signature">(endpoint, endpointResource)</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/IonResource.js#L27">Core/IonResource.js 27</a>
</div>
</h4>
</div>
<div class="description">
A <a href="Resource.html"><code>Resource</code></a> instance that encapsulates Cesium ion asset access.
This object is normally not instantiated directly, use <a href="IonResource.html#.fromAssetId"><code>IonResource.fromAssetId</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>endpoint</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
The result of the Cesium ion asset endpoint service.</td>
</tr>
<tr>
<td class="name"><code>endpointResource</code></td>
<td class="type">
<span class="param-type"><a href="Resource.html">Resource</a></span>
</td>
<td class="description last">
The resource used to retreive the endpoint.</td>
</tr>
</tbody>
</table>
<dl class="details">
<h5>See:</h5>
<ul class="see-list">
<li><a href="Ion.html">Ion</a></li>
<li><a href="IonImageryProvider.html">IonImageryProvider</a></li>
<li><a href="global.html#createWorldTerrain">createWorldTerrain</a></li>
<li><a href="https://cesium.com">https://cesium.com</a></li>
</ul>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="Resource.html">Resource</a></li>
</ul>
<h3 class="subsection-title">Members</h3>
<div class="nameContainer">
<h4 class="name" id="credits">
<a href="#credits" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> credits<span class="type-signature"> : Array.&lt;<a href="Credit.html">Credit</a>></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/IonResource.js#L120">Core/IonResource.js 120</a>
</div>
</h4>
</div>
<div class="description">
Gets the credits required for attribution of the asset.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="extension">
<a href="#extension" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> extension<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L486">Core/Resource.js 486</a>
</div>
</h4>
</div>
<div class="description">
The file extension of the resource.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#extension">Resource#extension</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="hasHeaders">
<a href="#hasHeaders" class="doc-link"></a>
hasHeaders<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L534">Core/Resource.js 534</a>
</div>
</h4>
</div>
<div class="description">
True if the Resource has request headers. This is equivalent to checking if the headers property has any keys.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#hasHeaders">Resource#hasHeaders</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="headers">
<a href="#headers" class="doc-link"></a>
headers<span class="type-signature"> : Object</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L284">Core/Resource.js 284</a>
</div>
</h4>
</div>
<div class="description">
Additional HTTP headers that will be sent with the request.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#headers">Resource#headers</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="isBlobUri">
<a href="#isBlobUri" class="doc-link"></a>
isBlobUri<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L510">Core/Resource.js 510</a>
</div>
</h4>
</div>
<div class="description">
True if the Resource refers to a blob URI.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#isBlobUri">Resource#isBlobUri</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="isCrossOriginUrl">
<a href="#isCrossOriginUrl" class="doc-link"></a>
isCrossOriginUrl<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L522">Core/Resource.js 522</a>
</div>
</h4>
</div>
<div class="description">
True if the Resource refers to a cross origin URL.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#isCrossOriginUrl">Resource#isCrossOriginUrl</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="isDataUri">
<a href="#isDataUri" class="doc-link"></a>
isDataUri<span class="type-signature"> : Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L498">Core/Resource.js 498</a>
</div>
</h4>
</div>
<div class="description">
True if the Resource refers to a data URI.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#isDataUri">Resource#isDataUri</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="proxy">
<a href="#proxy" class="doc-link"></a>
proxy<span class="type-signature"> : <a href="Proxy.html">Proxy</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L298">Core/Resource.js 298</a>
</div>
</h4>
</div>
<div class="description">
A proxy to be used when loading the resource.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#proxy">Resource#proxy</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="queryParameters">
<a href="#queryParameters" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> queryParameters<span class="type-signature"> : Object</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L436">Core/Resource.js 436</a>
</div>
</h4>
</div>
<div class="description">
Query parameters appended to the url.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#queryParameters">Resource#queryParameters</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="request">
<a href="#request" class="doc-link"></a>
request<span class="type-signature"> : <a href="Request.html">Request</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L291">Core/Resource.js 291</a>
</div>
</h4>
</div>
<div class="description">
A Request object that will be used. Intended for internal use only.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#request">Resource#request</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="retryAttempts">
<a href="#retryAttempts" class="doc-link"></a>
retryAttempts<span class="type-signature"> : Number</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L312">Core/Resource.js 312</a>
</div>
</h4>
</div>
<div class="description">
The number of times the retryCallback should be called before giving up.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#retryAttempts">Resource#retryAttempts</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="retryCallback">
<a href="#retryCallback" class="doc-link"></a>
retryCallback<span class="type-signature"> : function</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L305">Core/Resource.js 305</a>
</div>
</h4>
</div>
<div class="description">
Function to call when a request for this resource fails. If it returns true or a Promise that resolves to true, the request will be retried.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#retryCallback">Resource#retryCallback</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="templateValues">
<a href="#templateValues" class="doc-link"></a>
<span class="type-signature attribute-readonly">readonly</span> templateValues<span class="type-signature"> : Object</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L450">Core/Resource.js 450</a>
</div>
</h4>
</div>
<div class="description">
The key/value pairs used to replace template parameters in the url.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#templateValues">Resource#templateValues</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="url">
<a href="#url" class="doc-link"></a>
url<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L462">Core/Resource.js 462</a>
</div>
</h4>
</div>
<div class="description">
The url to the resource with template values replaced, query string appended and encoded by proxy if one was set.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#url">Resource#url</a>
</li></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<div class="nameContainer">
<h4 class="name" id=".fromAssetId">
<a href="#.fromAssetId" class="doc-link"></a>
<span class="type-signature attribute-static">static</span> Cesium.IonResource.fromAssetId<span class="signature">(assetId, <span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;<a href="IonResource.html">IonResource</a>></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/IonResource.js#L101">Core/IonResource.js 101</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously creates an instance.
</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>assetId</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">
The Cesium ion asset id.</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
An object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>accessToken</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="default">
<code class="language-javascript">Ion.defaultAccessToken</code>
</td>
<td class="description last">
<span class="optional">optional</span>
The access token to use.</td>
</tr>
<tr>
<td class="name"><code>server</code></td>
<td class="type">
<span class="param-type">String</span>
|
<span class="param-type"><a href="Resource.html">Resource</a></span>
</td>
<td class="default">
<code class="language-javascript">Ion.defaultServer</code>
</td>
<td class="description last">
<span class="optional">optional</span>
The resource to the Cesium ion API server.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
A Promise to am instance representing the Cesium ion Asset.
</div>
<dl class="details">
<h5>Examples:</h5>
<pre><code class="language-javascript">//Load a Cesium3DTileset with asset ID of 124624234
viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));</code></pre>
<pre><code class="language-javascript">//Load a CZML file with asset ID of 10890
Cesium.IonResource.fromAssetId(10890)
.then(function (resource) {
viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
});</code></pre>
</dl>
<div class="nameContainer">
<h4 class="name" id="appendForwardSlash">
<a href="#appendForwardSlash" class="doc-link"></a>
appendForwardSlash<span class="signature">()</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L781">Core/Resource.js 781</a>
</div>
</h4>
</div>
<div class="description">
Appends a forward slash to the URL.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#appendForwardSlash">Resource#appendForwardSlash</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="appendQueryParameters">
<a href="#appendQueryParameters" class="doc-link"></a>
appendQueryParameters<span class="signature">(params)</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L619">Core/Resource.js 619</a>
</div>
</h4>
</div>
<div class="description">
Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
as opposed to adding them one at a time to the queryParameters property.
</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>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
The query parameters</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#appendQueryParameters">Resource#appendQueryParameters</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="clone">
<a href="#clone" class="doc-link"></a>
clone<span class="signature">(<span class="optional">result</span>)</span> &rarr; <span class="type-signature returnType"><a href="Resource.html">Resource</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L747">Core/Resource.js 747</a>
</div>
</h4>
</div>
<div class="description">
Duplicates a Resource instance.
</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>result</code></td>
<td class="type">
<span class="param-type"><a href="Resource.html">Resource</a></span>
</td>
<td class="description last">
<span class="optional">optional</span>
The object onto which to store the result.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The modified result parameter or a new Resource instance if one was not provided.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#clone">Resource#clone</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="delete">
<a href="#delete" class="doc-link"></a>
delete<span class="signature">(<span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1564">Core/Resource.js 1564</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously deletes the given resource. Returns a promise that will resolve to
the result once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
The type of response. This controls the type of item returned.</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Additional HTTP headers to send with the request, if any.</td>
</tr>
<tr>
<td class="name"><code>overrideMimeType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Overrides the MIME type returned by the server.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#delete">Resource#delete</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">resource.delete()
.then(function(body) {
// use the data
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="fetch">
<a href="#fetch" class="doc-link"></a>
fetch<span class="signature">(<span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1508">Core/Resource.js 1508</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously loads the given resource. Returns a promise that will resolve to
the result once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled. It's recommended that you use
the more specific functions eg. fetchJson, fetchBlob, etc.
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
The type of response. This controls the type of item returned.</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Additional HTTP headers to send with the request, if any.</td>
</tr>
<tr>
<td class="name"><code>overrideMimeType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Overrides the MIME type returned by the server.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#fetch">Resource#fetch</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">resource.fetch()
.then(function(body) {
// use the data
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="fetchArrayBuffer">
<a href="#fetchArrayBuffer" class="doc-link"></a>
fetchArrayBuffer<span class="signature">()</span> &rarr; <span class="type-signature returnType">Promise.&lt;ArrayBuffer>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L804">Core/Resource.js 804</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously loads the resource as raw binary data. Returns a promise that will resolve to
an ArrayBuffer once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</div>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#fetchArrayBuffer">Resource#fetchArrayBuffer</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">// load a single URL asynchronously
resource.fetchArrayBuffer().then(function(arrayBuffer) {
// use the data
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="fetchBlob">
<a href="#fetchBlob" class="doc-link"></a>
fetchBlob<span class="signature">()</span> &rarr; <span class="type-signature returnType">Promise.&lt;Blob>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L848">Core/Resource.js 848</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously loads the given resource as a blob. Returns a promise that will resolve to
a Blob once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</div>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#fetchBlob">Resource#fetchBlob</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">// load a single URL asynchronously
resource.fetchBlob().then(function(blob) {
// use the data
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="fetchImage">
<a href="#fetchImage" class="doc-link"></a>
fetchImage<span class="signature">(<span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;ImageBitmap>|Promise.&lt;HTMLImageElement>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L902">Core/Resource.js 902</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously loads the given image resource. Returns a promise that will resolve to
an <a href="https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap">ImageBitmap</a> if <code>preferImageBitmap</code> is true and the browser supports <code>createImageBitmap</code> or otherwise an
<a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement">Image</a> once loaded, or reject if the image failed to load.
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
An object with the following properties.
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>preferBlob</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true, we will load the image via a blob.</td>
</tr>
<tr>
<td class="name"><code>preferImageBitmap</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true, image will be decoded during fetch and an <code>ImageBitmap</code> is returned.</td>
</tr>
<tr>
<td class="name"><code>flipY</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true, image will be vertically flipped during decode. Only applies if the browser supports <code>createImageBitmap</code>.</td>
</tr>
<tr>
<td class="name"><code>skipColorSpaceConversion</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true, any custom gamma or color profiles in the image will be ignored. Only applies if the browser supports <code>createImageBitmap</code>.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#fetchImage">Resource#fetchImage</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">// load a single image asynchronously
resource.fetchImage().then(function(image) {
// use the loaded image
}).otherwise(function(error) {
// an error occurred
});
// load several images in parallel
when.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
// images is an array containing all the loaded images
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="fetchJson">
<a href="#fetchJson" class="doc-link"></a>
fetchJson<span class="signature">()</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1170">Core/Resource.js 1170</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously loads the given resource as JSON. Returns a promise that will resolve to
a JSON object once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled. This function
adds 'Accept: application/json,&#42;&#47;&#42;;q=0.01' to the request headers, if not
already specified.
</div>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#fetchJson">Resource#fetchJson</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">resource.fetchJson().then(function(jsonData) {
// Do something with the JSON object
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="fetchJsonp">
<a href="#fetchJsonp" class="doc-link"></a>
fetchJsonp<span class="signature">(<span class="optional">callbackParameterName</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1275">Core/Resource.js 1275</a>
</div>
</h4>
</div>
<div class="description">
Requests a resource using JSONP.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>callbackParameterName</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="default">
<code class="language-javascript">'callback'</code>
</td>
<td class="description last">
<span class="optional">optional</span>
The callback parameter name that the server expects.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#fetchJsonp">Resource#fetchJsonp</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">// load a data asynchronously
resource.fetchJsonp().then(function(data) {
// use the loaded data
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="fetchText">
<a href="#fetchText" class="doc-link"></a>
fetchText<span class="signature">()</span> &rarr; <span class="type-signature returnType">Promise.&lt;String>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1123">Core/Resource.js 1123</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously loads the given resource as text. Returns a promise that will resolve to
a String once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</div>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#fetchText">Resource#fetchText</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">// load text from a URL, setting a custom header
const resource = new Resource({
url: 'http://someUrl.com/someJson.txt',
headers: {
'X-Custom-Header' : 'some value'
}
});
resource.fetchText().then(function(text) {
// Do something with the text
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest">XMLHttpRequest</a></li>
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="fetchXML">
<a href="#fetchXML" class="doc-link"></a>
fetchXML<span class="signature">()</span> &rarr; <span class="type-signature returnType">Promise.&lt;XMLDocument>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1232">Core/Resource.js 1232</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously loads the given resource as XML. Returns a promise that will resolve to
an XML Document once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</div>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#fetchXML">Resource#fetchXML</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">// load XML from a URL, setting a custom header
Cesium.loadXML('http://someUrl.com/someXML.xml', {
'X-Custom-Header' : 'some value'
}).then(function(document) {
// Do something with the document
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest">XMLHttpRequest</a></li>
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="getBaseUri">
<a href="#getBaseUri" class="doc-link"></a>
getBaseUri<span class="signature">(<span class="optional">includeQuery</span>)</span> &rarr; <span class="type-signature returnType">String</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L774">Core/Resource.js 774</a>
</div>
</h4>
</div>
<div class="description">
Returns the base path of the Resource.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>includeQuery</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
Whether or not to include the query string and fragment form the uri</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The base URI of the resource
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#getBaseUri">Resource#getBaseUri</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="getDerivedResource">
<a href="#getDerivedResource" class="doc-link"></a>
getDerivedResource<span class="signature">(options)</span> &rarr; <span class="type-signature returnType"><a href="Resource.html">Resource</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L658">Core/Resource.js 658</a>
</div>
</h4>
</div>
<div class="description">
Returns a resource relative to the current instance. All properties remain the same as the current instance unless overridden in options.
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
An object with the following properties
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
The url that will be resolved relative to the url of the current instance.</td>
</tr>
<tr>
<td class="name"><code>queryParameters</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
An object containing query parameters that will be combined with those of the current instance.</td>
</tr>
<tr>
<td class="name"><code>templateValues</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
Key/Value pairs that are used to replace template values (eg. {x}). These will be combined with those of the current instance.</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="default">
<code class="language-javascript">{}</code>
</td>
<td class="description last">
<span class="optional">optional</span>
Additional HTTP headers that will be sent.</td>
</tr>
<tr>
<td class="name"><code>proxy</code></td>
<td class="type">
<span class="param-type"><a href="Proxy.html">Proxy</a></span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
A proxy to be used when loading the resource.</td>
</tr>
<tr>
<td class="name"><code>retryCallback</code></td>
<td class="type">
<span class="param-type"><a href="Resource.html#.RetryCallback">Resource.RetryCallback</a></span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
The function to call when loading the resource fails.</td>
</tr>
<tr>
<td class="name"><code>retryAttempts</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="default">
</td>
<td class="description last">
<span class="optional">optional</span>
The number of times the retryCallback should be called before giving up.</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="default">
</td>
<td class="description last">
<span class="optional">optional</span>
A Request object that will be used. Intended for internal use only.</td>
</tr>
<tr>
<td class="name"><code>preserveQueryParameters</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true, this will keep all query parameters from the current resource and derived resource. If false, derived parameters will replace those of the current resource.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The resource derived from the current one.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#getDerivedResource">Resource#getDerivedResource</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="getUrlComponent">
<a href="#getUrlComponent" class="doc-link"></a>
getUrlComponent<span class="signature">(<span class="optional">query</span>, <span class="optional">proxy</span>)</span> &rarr; <span class="type-signature returnType">String</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L559">Core/Resource.js 559</a>
</div>
</h4>
</div>
<div class="description">
Returns the url, optional with the query string and processed by a proxy.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>query</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true, the query string is included.</td>
</tr>
<tr>
<td class="name"><code>proxy</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true, the url is processed by the proxy object, if defined.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
The url with all the requested components.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#getUrlComponent">Resource#getUrlComponent</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="head">
<a href="#head" class="doc-link"></a>
head<span class="signature">(<span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1622">Core/Resource.js 1622</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously gets headers the given resource. Returns a promise that will resolve to
the result once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
The type of response. This controls the type of item returned.</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Additional HTTP headers to send with the request, if any.</td>
</tr>
<tr>
<td class="name"><code>overrideMimeType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Overrides the MIME type returned by the server.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#head">Resource#head</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">resource.head()
.then(function(headers) {
// use the data
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="options">
<a href="#options" class="doc-link"></a>
options<span class="signature">(<span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1678">Core/Resource.js 1678</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously gets options the given resource. Returns a promise that will resolve to
the result once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</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>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
The type of response. This controls the type of item returned.</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Additional HTTP headers to send with the request, if any.</td>
</tr>
<tr>
<td class="name"><code>overrideMimeType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Overrides the MIME type returned by the server.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#options">Resource#options</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">resource.options()
.then(function(headers) {
// use the data
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="patch">
<a href="#patch" class="doc-link"></a>
patch<span class="signature">(data, <span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1858">Core/Resource.js 1858</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously patches data to the given resource. Returns a promise that will resolve to
the result once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
Data that is posted with the resource.</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
The type of response. This controls the type of item returned.</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Additional HTTP headers to send with the request, if any.</td>
</tr>
<tr>
<td class="name"><code>overrideMimeType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Overrides the MIME type returned by the server.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#patch">Resource#patch</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">resource.patch(data)
.then(function(result) {
// use the result
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="post">
<a href="#post" class="doc-link"></a>
post<span class="signature">(data, <span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1736">Core/Resource.js 1736</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously posts data to the given resource. Returns a promise that will resolve to
the result once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
Data that is posted with the resource.</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Data that is posted with the resource.</td>
</tr>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
The type of response. This controls the type of item returned.</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Additional HTTP headers to send with the request, if any.</td>
</tr>
<tr>
<td class="name"><code>overrideMimeType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Overrides the MIME type returned by the server.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#post">Resource#post</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">resource.post(data)
.then(function(result) {
// use the result
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="put">
<a href="#put" class="doc-link"></a>
put<span class="signature">(data, <span class="optional">options</span>)</span> &rarr; <span class="type-signature returnType">Promise.&lt;*>|undefined</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L1797">Core/Resource.js 1797</a>
</div>
</h4>
</div>
<div class="description">
Asynchronously puts data to the given resource. Returns a promise that will resolve to
the result once loaded, or reject if the resource failed to load. The data is loaded
using XMLHttpRequest, which means that in order to make requests to another origin,
the server must have Cross-Origin Resource Sharing (CORS) headers enabled.
</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>data</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
Data that is posted with the resource.</td>
</tr>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>responseType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
The type of response. This controls the type of item returned.</td>
</tr>
<tr>
<td class="name"><code>headers</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Additional HTTP headers to send with the request, if any.</td>
</tr>
<tr>
<td class="name"><code>overrideMimeType</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Overrides the MIME type returned by the server.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
a promise that will resolve to the requested data when loaded. Returns undefined if <code>request.throttle</code> is true and the request does not have high enough priority.
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#put">Resource#put</a>
</li></dd>
<h5>Example:</h5>
<pre><code class="language-javascript">resource.put(data)
.then(function(result) {
// use the result
}).otherwise(function(error) {
// an error occurred
});</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a></li>
<li><a href="http://wiki.commonjs.org/wiki/Promises/A">CommonJS Promises/A</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="setQueryParameters">
<a href="#setQueryParameters" class="doc-link"></a>
setQueryParameters<span class="signature">(params, <span class="optional">useAsDefault</span>)</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L597">Core/Resource.js 597</a>
</div>
</h4>
</div>
<div class="description">
Combines the specified object and the existing query parameters. This allows you to add many parameters at once,
as opposed to adding them one at a time to the queryParameters property. If a value is already set, it will be replaced with the new value.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="default">
</td>
<td class="description last">
The query parameters</td>
</tr>
<tr>
<td class="name"><code>useAsDefault</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true the params will be used as the default values, so they will only be set if they are undefined.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#setQueryParameters">Resource#setQueryParameters</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="setTemplateValues">
<a href="#setTemplateValues" class="doc-link"></a>
setTemplateValues<span class="signature">(template, <span class="optional">useAsDefault</span>)</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L634">Core/Resource.js 634</a>
</div>
</h4>
</div>
<div class="description">
Combines the specified object and the existing template values. This allows you to add many values at once,
as opposed to adding them one at a time to the templateValues property. If a value is already set, it will become an array and the new value will be appended.
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>template</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="default">
</td>
<td class="description last">
The template values</td>
</tr>
<tr>
<td class="name"><code>useAsDefault</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
If true the values will be used as the default values, so they will only be set if they are undefined.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#setTemplateValues">Resource#setTemplateValues</a>
</li></dd>
</dl>
<div class="nameContainer">
<h4 class="name" id="toString">
<a href="#toString" class="doc-link"></a>
toString<span class="signature">()</span> &rarr; <span class="type-signature returnType">String</span>
<div class="source-link rightLinks">
<a href="https://github.com/CesiumGS/cesium/blob/1.91/Source/Core/Resource.js#L547">Core/Resource.js 547</a>
</div>
</h4>
</div>
<div class="description">
Override Object#toString so that implicit string conversion gives the
complete URL represented by this Resource.
</div>
<h5>Returns:</h5>
<div class="param-desc">
The URL represented by this Resource
</div>
<dl class="details">
<dt class="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a href="Resource.html#toString">Resource#toString</a>
</li></dd>
</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>