English中文

IonImageryProvider

new Cesium.IonImageryProvider(options)

要构造 IonImageryProvider,请调用 To construct a IonImageryProvider, call IonImageryProvider.fromAssetId。不要直接调用构造函数。 . Do not call the constructor directly.
使用Cesium离子 REST API 提供平铺图像。 Provides tiled imagery using the Cesium ion REST API.
名称 Name 类型 Type 说明 Description
options IonImageryProvider.ConstructorOptions 可选 optional 描述初始化选项的对象 Object describing initialization options
示例: Example:
const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));
viewer.imageryLayers.add(imageryLayer);
另见: See:

成员 Members

获取此图像提供程序处于活动状态时要显示的信用。通常,这用于证明图像的来源。 Gets the credit to display when this imagery provider is active. Typically this is used to credit the source of the imagery.
获取当图像提供程序遇到异步错误时引发的事件。通过订阅该事件,您将收到错误通知,并有可能从中恢复。事件监听器传递一个实例 Gets an event that is raised when the imagery 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 TileProviderError.

readonly hasAlphaChannel : boolean

获取一个值,该值指示此图像提供程序提供的图像是否包含 Alpha 通道。如果此属性为 false,则 Alpha 通道(如果存在)将被忽略。如果此属性为 true,则任何没有 Alpha 通道的图像都将被视为其 Alpha 在任何地方都是 1.0。当此属性为 false 时,内存使用量和纹理上传时间都会减少。 Gets a value indicating whether or not the images provided by this imagery provider include an alpha channel. If this property is false, an alpha channel, if present, will be ignored. If this property is true, any images without an alpha channel will be treated as if their alpha is 1.0 everywhere. When this property is false, memory usage and texture upload time are reduced.

readonly maximumLevel : number|undefined

获取可以请求的最大详细程度。 Gets the maximum level-of-detail that can be requested.

readonly minimumLevel : number

获取可以请求的最低详细程度。通常,仅当图像的矩形足够小以致于最小级别的图块数量较小时才应使用最小级别。在最低级别上具有多个图块的图像提供程序将导致渲染问题。 Gets the minimum level-of-detail that can be requested. Generally, a minimum level should only be used when the rectangle of the imagery is small enough that the number of tiles at the minimum level is small. An imagery provider with more than a few tiles at the minimum level will lead to rendering problems.
获取此提供者使用的代理。 Gets the proxy used by this provider.
默认值: Default Value: undefined
获取实例提供的图像的矩形(以弧度为单位)。 Gets the rectangle, in radians, of the imagery provided by the instance.
获取图块丢弃策略。如果未定义,则丢弃策略负责通过其 shouldDiscardImage 函数过滤掉“丢失”的图块。如果此函数返回未定义,则不会过滤任何图块。 Gets the tile discard policy. If not undefined, the discard policy is responsible for filtering out "missing" tiles via its shouldDiscardImage function. If this function returns undefined, no tiles are filtered.

readonly tileHeight : number

获取每个图块的高度(以像素为单位)。 Gets the height of each tile, in pixels.

readonly tileWidth : number

获取每个图块的宽度(以像素为单位)。 Gets the width of each tile, in pixels.
获取提供者使用的切片方案。 Gets the tiling scheme used by the provider.

方法 Methods

static Cesium.IonImageryProvider.fromAssetId(assetId, options)Promise.<IonImageryProvider>

使用 Cesium ion REST API 创建平铺图像的提供程序。 Creates a provider for tiled imagery using the Cesium ion REST API.
名称 Name 类型 Type 说明 Description
assetId number 离子图像资产 ID。 An ion imagery asset ID.
options IonImageryProvider.ConstructorOptions 可选 optional 描述初始化选项的对象。 Object describing initialization options.
返回: Returns:
解析为创建的 IonImageryProvider 的承诺。 A promise which resolves to the created IonImageryProvider.
抛出: Throws:
  • RuntimeError :Cesium离子 assetId 不是图像资产 : Cesium ion assetId is not an imagery asset
  • RuntimeError :无法识别的Cesium离子图像类型 : Unrecognized Cesium ion imagery type
示例: Example:
const imageryLayer = Cesium.ImageryLayer.fromProviderAsync(Cesium.IonImageryProvider.fromAssetId(3812));
viewer.imageryLayers.add(imageryLayer);

getTileCredits(x, y, level)Array.<Credit>

获取显示给定图块时要显示的积分。 Gets the credits to be displayed when a given tile is displayed.
名称 Name 类型 Type 说明 Description
x number 平铺 X 坐标。 The tile X coordinate.
y number 平铺 Y 坐标。 The tile Y coordinate.
level number 瓷砖水平; The tile level;
返回: Returns:
显示图块时要显示的制作人员名单。 The credits to be displayed when the tile is displayed.

pickFeatures(x, y, level, longitude, latitude)Promise.<Array.<ImageryLayerFeatureInfo>>|undefined

异步确定哪些要素(如果有)位于切片内给定经度和纬度处。此函数是可选的,因此它可能并不存在于所有 ImageryProvider 上。 Asynchronously determines what features, if any, are located at a given longitude and latitude within a tile. This function is optional, so it may not exist on all ImageryProviders.
名称 Name 类型 Type 说明 Description
x number 平铺 X 坐标。 The tile X coordinate.
y number 平铺 Y 坐标。 The tile Y coordinate.
level number 瓷砖级别。 The tile level.
longitude number 选择要素的经度。 The longitude at which to pick features.
latitude number 选择特征的纬度。 The latitude at which to pick features.
返回: Returns:
对所选取功能的承诺将在异步选取完成时解决。解析后的值是一个数组 A promise for the picked features that will resolve when the asynchronous picking completes. The resolved value is an array of ImageryLayerFeatureInfo 实例。如果在给定位置未找到要素,则数组可能为空。如果不支持拾取,它也可能是未定义的。 instances. The array may be empty if no features are found at the given location. It may also be undefined if picking is not supported.

requestImage(x, y, level, request)Promise.<ImageryTypes>|undefined

请求给定图块的图像。 Requests the image for a given tile.
名称 Name 类型 Type 说明 Description
x number 平铺 X 坐标。 The tile X coordinate.
y number 平铺 Y 坐标。 The tile Y coordinate.
level number 瓷砖级别。 The tile level.
request Request 可选 optional 请求对象。仅供内部使用。 The request object. Intended for internal use only.
返回: Returns:
对图像的承诺,该承诺将在图像可用时解析,或者如果对服务器的活动请求太多,则未定义,并且应稍后重试该请求。 A promise for the image that will resolve when the image is available, or undefined if there are too many active requests to the server, and the request should be retried later.

类型定义 Type Definitions

Cesium.IonImageryProvider.ConstructorOptions

TileMapServiceImageryProvider 构造函数的初始化选项 Initialization options for the TileMapServiceImageryProvider constructor
属性: Properties:
名称 Name 类型 Type Attributes 默认值 Default 说明 Description
accessToken string <可选> &lt;optional>
Ion.defaultAccessToken 要使用的访问令牌。 The access token to use.
server string | Resource <可选> &lt;optional>
Ion.defaultServer Cesium ion API 服务器的资源。 The resource to the Cesium ion API server.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.