Provides tiled imagery served by WMTS 1.0.0 compliant servers.
此提供者支持 NT 0 NT 1 -编码和RESTful GetTile请求,但尚未支持 NT 2 编码.
| Name | Type | Description |
|---|---|---|
options |
WebMapTileServiceImageryProvider.ConstructorOptions | 描述初始化选项的对象 |
Examples:
// Example 1. USGS shaded relief tiles (KVP)
const shadedRelief1 = new Cesium.WebMapTileServiceImageryProvider({
url : 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS',
layer : 'USGSShadedReliefOnly',
style : 'default',
format : 'image/jpeg',
tileMatrixSetID : 'default028mm',
// tileMatrixLabels : ['default028mm:0', 'default028mm:1', 'default028mm:2' ...],
maximumLevel: 19,
credit : new Cesium.Credit('U. S. Geological Survey')
});
viewer.imageryLayers.addImageryProvider(shadedRelief1);
// Example 2. USGS shaded relief tiles (RESTful)
const shadedRelief2 = new Cesium.WebMapTileServiceImageryProvider({
url : 'https://basemap.nationalmap.gov/arcgis/rest/services/USGSShadedReliefOnly/MapServer/WMTS/tile/1.0.0/USGSShadedReliefOnly/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpg',
layer : 'USGSShadedReliefOnly',
style : 'default',
format : 'image/jpeg',
tileMatrixSetID : 'default028mm',
maximumLevel: 19,
credit : new Cesium.Credit('U. S. Geological Survey')
});
viewer.imageryLayers.addImageryProvider(shadedRelief2);
// Example 3. NASA time dynamic weather data (RESTful)
const times = Cesium.TimeIntervalCollection.fromIso8601({
iso8601: '2015-07-30/2017-06-16/P1D',
dataCallback: function dataCallback(interval, index) {
return {
Time: Cesium.JulianDate.toIso8601(interval.start)
};
}
});
const weather = new Cesium.WebMapTileServiceImageryProvider({
url : 'https://gibs.earthdata.nasa.gov/wmts/epsg4326/best/AMSR2_Snow_Water_Equivalent/default/{Time}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png',
layer : 'AMSR2_Snow_Water_Equivalent',
style : 'default',
tileMatrixSetID : '2km',
maximumLevel : 5,
format : 'image/png',
clock: clock,
times: times,
credit : new Cesium.Credit('NASA Global Imagery Browse Services for EOSDIS')
});
viewer.imageryLayers.addImageryProvider(weather);
Demo:
See:
Members
clock : Clock
获取或设置用于保留时间动态参数所用时间的时钟.
readonly credit : Credit
当图像提供者活动时, 获得信用值以显示 。 通常,这是用来信用的
图像的来源.
获取或设置包含静态维度及其值的对象.
readonly errorEvent : Event
获得一个在图像提供者遇到同步错误时上升的事件 。 通过签名
对事件,您将被通知错误,并有可能从中恢复。 活动听众
are passed an instance of
TileProviderError.
获取图像提供者返回的 MIME 类型的图像 .
获得一个表示图像提供者是否提供的图像的值
包括一个α通道。 如果这个属性是虚假的, 一个 alpha 通道, 如果存在, 将会
将被忽略。 如果此属性属实, 任何没有 alpha 通道的图像都会被处理
好像他们的α是1.0 到处都是。 当此属性为虚假时, 内存使用
并缩短纹理上传时间.
获取可以请求的最多详细级别.
获取可以请求的最小详细级别.
readonly proxy : Proxy
获取此提供者使用的代理 .
readonly rectangle : Rectangle
用弧度表示这个例子提供的图像的矩形.
readonly tileDiscardPolicy : TileDiscardPolicy
获取瓷砖丢弃策略 。 如果未定义, 丢弃策略负责
用于通过它应当的DiscardImage函数过滤出“缺少”牌。 如果此函数
返回未定义,不过滤牌.
获得每个瓦片的高度,以像素为单位.
获得每个瓦片的宽度,以像素为单位.
readonly tilingScheme : TilingScheme
获得此提供者使用的平板方案 .
times : TimeIntervalCollection
获取或设置用于获取时间动态参数的时间间隔集合. 数据
TimeInterval 是一个包含在
tile requests.
Gets the URL of the service hosting the imagery.
Methods
getTileCredits(x, y, level) → Array.<Credit>
获得在显示特定瓦片时显示的信用值.
| Name | Type | Description |
|---|---|---|
x |
number | 瓷砖X坐标. |
y |
number | 瓦片Y坐标. |
level |
number | 瓦片级; |
Returns:
显示瓷砖时要显示的信用值 .
Picking 特性目前不被此图像提供者支持, 因此此函数仅返回
undefined.
| Name | Type | Description |
|---|---|---|
x |
number | 瓷砖X坐标. |
y |
number | 瓦片Y坐标. |
level |
number | 瓦片级. |
longitude |
number | 选择特征的经度 . |
latitude |
number | 选择特征的纬度. |
Returns:
不支持选择后未定义 .
requestImage(x, y, level, request) → Promise.<ImageryTypes>|undefined
请求给定的瓦片的图像 .
| Name | Type | Description |
|---|---|---|
x |
number | 瓷砖X坐标. |
y |
number | 瓦片Y坐标. |
level |
number | 瓦片级. |
request |
Request | optional 请求对象 。 仅供内部使用. |
Returns:
承诺在图像可用时解决图像,或
如果服务器的主动请求过多, 未定义, 请求应在稍后重审 .
Type Definitions
WebMapTileServiceImagery 创建器的初始化选项
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
url |
Resource | string | The base URL for the WMTS GetTile operation (for KVP-encoded requests) or the tile-URL template (for RESTful requests). The tile-URL template should contain the following variables: {style}, {TileMatrixSet}, {TileMatrix}, {TileRow}, {TileCol}. The first two are optional if actual values are hardcoded or not required by the server. The {s} keyword may be used to specify subdomains. | ||
format |
string |
<optional> |
'image/jpeg' | The MIME type for images to retrieve from the server. |
layer |
string | NT 0 请求的层名. | ||
style |
string | NT 0 请求的样式名称. | ||
tileMatrixSetID |
string | The identifier of the TileMatrixSet to use for WMTS requests. | ||
tileMatrixLabels |
Array |
<optional> |
A list of identifiers in the TileMatrix to use for WMTS requests, one per TileMatrix level. | |
clock |
Clock |
<optional> |
A Clock instance that is used when determining the value for the time dimension. Required when `times` is specified. | |
times |
TimeIntervalCollection |
<optional> |
TimeInterval Collection, 其属性为 NT 0 data NT 1 是一个包含时间动态维度及其值的对象. | |
dimensions |
object |
<optional> |
包含静态维度及其值的天体. | |
tileWidth |
number |
<optional> |
256 | 瓦片宽度以像素表示. |
tileHeight |
number |
<optional> |
256 | 瓦片高度以像素表示. |
tilingScheme |
TilingScheme |
<optional> |
与TileMatrixSet中的瓦片组织相对应的平板方案. | |
rectangle |
Rectangle |
<optional> |
Rectangle.MAX_VALUE | The rectangle covered by the layer. |
minimumLevel |
number |
<optional> |
0 | The minimum level-of-detail supported by the imagery provider. |
maximumLevel |
number |
<optional> |
图像提供者支持的最大详细水平,或者在没有限制的情况下未定义. | |
ellipsoid |
Ellipsoid |
<optional> |
椭圆形. 如果未指定,则使用 NT 0 椭圆形. | |
credit |
Credit | string |
<optional> |
数据源的信用,在画布上显示. | |
subdomains |
string | Array.<string> |
<optional> |
'abc' | The subdomains to use for the {s} placeholder in the URL template.
如果这个参数是单字符串,字符串中的每个字符都是子域. 如果是的话
一个数组,数组中的每个元素都是子域. |