封装cesium离子资产访问的
       
        
      
         Resource
        
       
       实例。此对象通常不直接实例化,请使用
       
        
         IonResource.fromAssetId
        
       
       。
      | Name | Type | Description | 
|---|---|---|
          
           endpoint
          
          | 
         Object | cesium离子资产端点服务的结果。 | 
          
           endpointResource
          
          | 
         Resource | 用于检索端点的资源。 | 
Extends
Members
readonly credits : Array.< Credit >
      获取资产归属所需的信用。
     
     
      资源的文件扩展名。
     
     - Inherited From:
 
      如果资源具有请求标头,则为真。这相当于检查 headers 属性是否有任何键。
     
     - Inherited From:
 
      将随请求一起发送的附加 HTTP 标头。
     
     - Inherited From:
 
      如果 Resource 引用了 blob URI,则为真。
     
     - Inherited From:
 
      如果资源引用跨源 URL,则为真。
     
     - Inherited From:
 
      如果资源引用数据 URI,则为真。
     
     - Inherited From:
 
proxy : Proxy
      加载资源时要使用的代理。
     
     - Inherited From:
 
      附加到 url 的查询参数。
     
     - Inherited From:
 
request : Request
      将使用的 Request 对象。仅供内部使用。
     
     - Inherited From:
 
      在放弃之前应该调用 retryCallback 的次数。
     
     - Inherited From:
 
      当对该资源的请求失败时调用的函数。如果它返回 true 或解析为 true 的 Promise,则将重试请求。
     
     - Inherited From:
 
      用于替换 url 中模板参数的键/值对。
     
     - Inherited From:
 
      替换模板值的资源 url,如果设置了查询字符串,则由代理附加和编码。
     
     - Inherited From:
 
Methods
static Cesium.IonResource.fromAssetId (assetId, options ) → Promise.< IonResource >
      异步创建实例。
     
     | Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          assetId
         
         | 
        Number | cesium离子资产 ID。 | ||||||||||||
         
          options
         
         | 
        Object | 
         
          可选
         
         具有以下属性的对象:
         
  | 
       
Returns:
   一个 Promise to am 代表cesium离子资产的实例。
  
 
     Examples:
//Load a Cesium3DTileset with asset ID of 124624234
viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));
      //Load a CZML file with asset ID of 10890
Cesium.IonResource.fromAssetId(10890)
  .then(function (resource) {
    viewer.dataSources.add(Cesium.CzmlDataSource.load(resource));
  });
     
      将正斜杠附加到 URL。
     
     - Inherited From:
 
      组合指定的对象和现有的查询参数。这允许您一次添加多个参数,而不是一次将它们添加到 queryParameters 属性。
     
     | Name | Type | Description | 
|---|---|---|
         
          params
         
         | 
        Object | 查询参数 | 
- Inherited From:
 
clone ( result ) → Resource
      复制资源实例。
     
     | Name | Type | Description | 
|---|---|---|
         
          result
         
         | 
        Resource | 可选 存储结果的对象。 | 
Returns:
   修改后的结果参数或新的资源实例(如果未提供)。
  
 
     - Inherited From:
 
      异步删除给定的资源。返回一个承诺,一旦加载就会解析为结果,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     | Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          options
         
         | 
        Object | 
         具有以下属性的
         
          可选
         
         对象:
         
  | 
       
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
resource.delete()
  .then(function(body) {
      // use the data
  }).catch(function(error) {
      // an error occurred
  });
      See:
      异步加载给定的资源。返回一个承诺,一旦加载就会解析为结果,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。建议您使用更具体的功能,例如。 fetchJson、fetchBlob 等
     
     | Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          options
         
         | 
        Object | 
         具有以下属性的
         
          可选
         
         对象:
         
  | 
       
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
resource.fetch()
  .then(function(body) {
      // use the data
  }).catch(function(error) {
      // an error occurred
  });
      See:
      将资源作为原始二进制数据异步加载。返回一个承诺,一旦加载就会解析为 ArrayBuffer,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
// load a single URL asynchronously
resource.fetchArrayBuffer().then(function(arrayBuffer) {
    // use the data
}).catch(function(error) {
    // an error occurred
});
      See:
      将给定资源作为 blob 异步加载。返回一个在加载后将解析为 Blob 的承诺,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
// load a single URL asynchronously
resource.fetchBlob().then(function(blob) {
    // use the data
}).catch(function(error) {
    // an error occurred
});
      See:
      异步加载给定的图像资源。如果
      
     
       preferImageBitmap
      
      为 true 并且浏览器支持
      
       createImageBitmap
      
      或其他
      
       图像
      
      一旦加载,则返回将解析为
      
       ImageBitmap
      
      的承诺,或者如果图像加载失败则拒绝。
     | Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          options
         
         | 
        Object | 
         
          可选
         
         具有以下属性的对象。
         
  | 
       
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
// load a single image asynchronously
resource.fetchImage().then(function(image) {
    // use the loaded image
}).catch(function(error) {
    // an error occurred
});
// load several images in parallel
Promise.all([resource1.fetchImage(), resource2.fetchImage()]).then(function(images) {
    // images is an array containing all the loaded images
});
      See:
      将给定资源作为 JSON 异步加载。返回一个在加载后将解析为 JSON 对象的承诺,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。如果尚未指定,此函数会将 'Accept: application/json,*/*;q=0.01' 添加到请求标头中。
     
     Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
resource.fetchJson().then(function(jsonData) {
    // Do something with the JSON object
}).catch(function(error) {
    // an error occurred
});
      See:
      使用 JSONP 请求资源。
     
     | Name | Type | Default | Description | 
|---|---|---|---|
         
          callbackParameterName
         
         | 
        String | 
         
          'callback'
         
         | 
        可选 服务器期望的回调参数名称。 | 
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
// load a data asynchronously
resource.fetchJsonp().then(function(data) {
    // use the loaded data
}).catch(function(error) {
    // an error occurred
});
      See:
      将给定资源作为文本异步加载。返回一个承诺,一旦加载将解析为字符串,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
// 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
}).catch(function(error) {
    // an error occurred
});
      See:
      将给定资源作为 XML 异步加载。返回一个加载后将解析为 XML 文档的承诺,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
// 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
}).catch(function(error) {
    // an error occurred
});
      See:
      返回资源的基本路径。
     
     | Name | Type | Default | Description | 
|---|---|---|---|
         
          includeQuery
         
         | 
        Boolean | 
         
          false
         
         | 
        可选 是否在 uri 中包含查询字符串和片段 | 
Returns:
   资源的基本 URI
  
 
     - Inherited From:
 
getDerivedResource (options) → Resource
      返回相对于当前实例的资源。除非在选项中被覆盖,否则所有属性都与当前实例相同。
     
     | Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          options
         
         | 
        Object | 
         具有以下属性的对象
         
  | 
       
Returns:
   从当前资源派生的资源。
  
 
     - Inherited From:
 
      返回 url,可选与查询字符串并由代理处理。
     
     | Name | Type | Default | Description | 
|---|---|---|---|
         
          query
         
         | 
        Boolean | 
         
          false
         
         | 
        可选 如果为 true,则包含查询字符串。 | 
         
          proxy
         
         | 
        Boolean | 
         
          false
         
         | 
        可选 如果为 true,则 url 由代理对象处理(如果已定义)。 | 
Returns:
   包含所有请求组件的 url。
  
 
     - Inherited From:
 
      异步获取给定资源的标头。返回一个承诺,一旦加载就会解析为结果,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     | Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          options
         
         | 
        Object | 
         具有以下属性的
         
          可选
         
         对象:
         
  | 
       
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
resource.head()
  .then(function(headers) {
      // use the data
  }).catch(function(error) {
      // an error occurred
  });
      See:
      异步获取给定资源的选项。返回一个承诺,一旦加载就会解析为结果,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     | Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          options
         
         | 
        Object | 
         具有以下属性的
         
          可选
         
         对象:
         
  | 
       
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
resource.options()
  .then(function(headers) {
      // use the data
  }).catch(function(error) {
      // an error occurred
  });
      See:
      将数据异步修补到给定资源。返回一个承诺,一旦加载就会解析为结果,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     | Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          data
         
         | 
        Object | 随资源发布的数据。 | ||||||||||||
         
          options
         
         | 
        Object | 
         具有以下属性的
         
          可选
         
         对象:
         
  | 
       
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
resource.patch(data)
  .then(function(result) {
      // use the result
  }).catch(function(error) {
      // an error occurred
  });
      See:
      将数据异步发布到给定资源。返回一个承诺,一旦加载就会解析为结果,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     | Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          data
         
         | 
        Object | 随资源发布的数据。 | |||||||||||||||
         
          options
         
         | 
        Object | 
         具有以下属性的
         
          可选
         
         对象:
         
  | 
       
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
resource.post(data)
  .then(function(result) {
      // use the result
  }).catch(function(error) {
      // an error occurred
  });
      See:
      异步将数据放入给定的资源。返回一个承诺,一旦加载就会解析为结果,或者如果资源加载失败则拒绝。数据是使用 XMLHttpRequest 加载的,这意味着为了向另一个源发出请求,服务器必须启用跨源资源共享 (CORS) 标头。
     
     | Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
         
          data
         
         | 
        Object | 随资源发布的数据。 | ||||||||||||
         
          options
         
         | 
        Object | 
         具有以下属性的
         
          可选
         
         对象:
         
  | 
       
Returns:
   加载时将解析为请求的数据的承诺。如果
   
 
     
    request.throttle
   
   为 true 并且请求没有足够高的优先级,则返回 undefined。
  - Inherited From:
 
Example:
resource.put(data)
  .then(function(result) {
      // use the result
  }).catch(function(error) {
      // an error occurred
  });
      See:
      组合指定的对象和现有的查询参数。这允许您一次添加多个参数,而不是一次将它们添加到 queryParameters 属性。如果已经设置了一个值,它将被新值替换。
     
     | Name | Type | Default | Description | 
|---|---|---|---|
         
          params
         
         | 
        Object | 查询参数 | |
         
          useAsDefault
         
         | 
        Boolean | 
         
          false
         
         | 
        可选 如果为 true,则参数将用作默认值,因此只有在未定义时才会设置它们。 | 
- Inherited From:
 
      组合指定的对象和现有的模板值。这允许您一次添加多个值,而不是一次将它们添加到 templateValues 属性。如果已经设置了一个值,它将成为一个数组并附加新值。
     
     | Name | Type | Default | Description | 
|---|---|---|---|
         
          template
         
         | 
        Object | 模板值 | |
         
          useAsDefault
         
         | 
        Boolean | 
         
          false
         
         | 
        可选 如果为 true,则这些值将用作默认值,因此只有在未定义时才会设置它们。 | 
- Inherited From:
 
      覆盖 Object#toString 以便隐式字符串转换提供此资源表示的完整 URL。
     
     Returns:
   此资源表示的 URL
  
 
     - Inherited From: