类名 SingleImageryProvider

# new SingleImageryProvider(options)

一张图出图的服务接入类

参数:

名称 类型 默认值 描述
options Object

初始化时的构造参数

viewer Cesium.Viewer

cesium视图对象

url Cesium.Resource | String null

服务的基地址,支持url字符串和Cesium.Resource两种类型,当类型为Cesium.Resource时,支持传入额外请求参数、请求头参数等,具体请参考Cesium.Resource

layers String null

要显示的子图层id,多个子图层以逗号分隔,'layer1,layer2,...',如果要显示所有层,则请传一个空字符串

tilingScheme Cesium.TilingScheme | CustomTilingScheme Cesium.GeographicTilingScheme

瓦片的平铺方案,详见Cesium.TilingScheme

rectangle Cesium.Rectangle Cesium.Rectangle.MAX_VALUE

地图图层显示范围,超出范围不会额外请求瓦片,详见Cesium.Rectangle

spatialReference SpatialReference new SpatialReference({ wkid: 4326 })

图层空间参考系

httpMethod String 'GET'

HTTP请求方式,"GET"、"POST",默认为GET请求

minimumLevel number 0

图层最小请求瓦片级别,小于该级别不再请求瓦片

maximumLevel number 20

图层最大请求瓦片级别,大于该级别不再请求瓦片

proxy String null

转发代理

build2DImageResource function null

重载build2DImageResource方法,来重载瓦片的请求逻辑

成员变量

Cesium.Event

# readonly errorEvent

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. Cesium.Event listeners are passed an instance of Cesium.TileProviderError.

Cesium.Rectangle

# rectangle

Gets the rectangle, in radians, of the imagery provided by this instance.

方法

# _addEvent()

provider添加相机监听事件

# async fromUrl(url, optionsopt)

Creates a provider for a single, top-level imagery tile. The single image is assumed to use a

参数:

名称 类型 描述
url Cesium.Resource | String

服务的基地址,支持url字符串和Cesium.Resource两种类型,当类型为Cesium.Resource时,支持传入额外请求参数、请求头参数等,具体请参考Cesium.Resource

options SingleImageryProvider.fromUrlOptions

Object describing initialization options.

The resolved SingleImageryProvider.

Promise

# requestImage(x, y, level, requestopt, imageryRectangleopt)

请求给定贴图的图像

参数:

名称 类型 描述
x number

瓦片的X坐标

y number

瓦片的Y坐标

level number

瓦片的详细级别

request Request

The request object. Intended for internal use only.

imageryRectangle Request

图片范围

The resolved image

Promise.<ImageryTypes> | undefined
构造函数
成员变量
方法
事件