Provides imagery by requesting tiles using a specified URL template.
| Name | Type | Description |
|---|---|---|
options |
UrlTemplateImageryProvider.ConstructorOptions | 描述初始化选项的对象 |
Example:
// Access Natural Earth II imagery, which uses a TMS tiling scheme and Geographic (EPSG:4326) project
const tms = new Cesium.UrlTemplateImageryProvider({
url : Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII') + '/{z}/{x}/{reverseY}.jpg',
tilingScheme : new Cesium.GeographicTilingScheme(),
maximumLevel : 5
});
// Access the CartoDB Positron basemap, which uses an OpenStreetMap-like tiling scheme.
const positron = new Cesium.UrlTemplateImageryProvider({
url : 'http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png',
credit : 'Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.'
});
// Access a Web Map Service (WMS) server.
const wms = new Cesium.UrlTemplateImageryProvider({
url : 'https://services.ga.gov.au/gis/services/NM_Hydrology_and_Marine_Points/MapServer/WMSServer?' +
'tiled=true&transparent=true&format=image%2Fpng&exceptions=application%2Fvnd.ogc.se_xml&' +
'styles=&service=WMS&version=1.3.0&request=GetMap&' +
'layers=Bores&crs=EPSG%3A3857&' +
'bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&' +
'width=256&height=256',
rectangle : Cesium.Rectangle.fromDegrees(95.0, -55.0, 170.0, -1.0) // From GetCapabilities EX_GeographicBoundingBox
});
// Using custom tags in your template url.
const custom = new Cesium.UrlTemplateImageryProvider({
url : 'https://yoururl/{Time}/{z}/{y}/{x}.png',
customTags : {
Time: function(imageryProvider, x, y, level) {
return '20171231'
}
}
});
See:
Members
readonly credit : Credit
当图像提供者活动时, 获得信用值以显示 。 通常,这是用来信用的
图像的来源.
-
Default Value:
undefined
Gets or sets a value indicating whether feature picking is enabled. If true,
UrlTemplateImageryProvider#pickFeatures will
,并试图解释答复中包含的特性。 如果说错了,
UrlTemplateImageryProvider#pickFeatures will immediately return undefined (indicating no pickable
特性),不与服务器通信. 如果您知道您的数据, 请将此属性设定为虚假
来源不支持选择特性, 或者如果您不希望此提供者的特性可以选择 .
-
Default Value:
true
readonly errorEvent : Event
获得一个在图像提供者遇到同步错误时上升的事件 。 通过签名
对事件,您将被通知错误,并有可能从中恢复。 活动听众
are passed an instance of
TileProviderError.
获得一个表示图像提供者是否提供的图像的值
包括一个α通道。 如果这个属性是虚假的, 一个 alpha 通道, 如果存在, 将会
将被忽略。 如果此属性属实, 任何没有 alpha 通道的图像都会被处理
好像他们的α是1.0 到处都是。 当此属性为虚假时, 内存使用
并缩短纹理上传时间.
-
Default Value:
true
获得可以请求的最多详细级别,或者在没有限制的情况下未定义.
-
Default Value:
undefined
获取可以请求的最小详细级别.
-
Default Value:
0
获得 NT 0 模板用于选择特性. 如果不指明此财产,
UrlTemplateImageryProvider#pickFeatures will immediately return undefined, indicating no
features picked. The URL template supports all of the keywords supported by the
UrlTemplateImageryProvider#url property, plus the following:
{i}: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.{j}: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.{reverseI}: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.{reverseJ}: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.{longitudeDegrees}: The longitude of the picked position in degrees.{latitudeDegrees}: The latitude of the picked position in degrees.{longitudeProjected}: The longitude of the picked position in the projected coordinates of the tiling scheme.{latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.{format}: The format in which to get feature information, as specified in theGetFeatureInfoFormat.
readonly proxy : Proxy
获取此提供者使用的代理 .
-
Default Value:
undefined
readonly rectangle : Rectangle
用弧度表示这个例子提供的图像的矩形.
-
Default Value:
tilingScheme.rectangle
readonly tileDiscardPolicy : TileDiscardPolicy
获取瓷砖丢弃策略 。 如果未定义, 丢弃策略负责
用于通过它应当的DiscardImage函数过滤出“缺少”牌。 如果此函数
返回未定义,不过滤牌.
-
Default Value:
undefined
获得每个瓦片的高度,以像素为单位.
-
Default Value:
256
获得每个瓦片的宽度,以像素为单位.
-
Default Value:
256
readonly tilingScheme : TilingScheme
获得此提供者使用的平板方案 .
-
Default Value:
new WebMercatorTilingScheme()
Gets the URL template to use to request tiles. It has the following keywords:
-
{z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid. -
{x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile. -
{y}: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile. -
{s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host. -
{reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile. -
{reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile. -
{reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined. -
{westDegrees}: The Western edge of the tile in geodetic degrees. -
{southDegrees}: The Southern edge of the tile in geodetic degrees. -
{eastDegrees}: The Eastern edge of the tile in geodetic degrees. -
{northDegrees}: The Northern edge of the tile in geodetic degrees. -
{westProjected}: The Western edge of the tile in projected coordinates of the tiling scheme. -
{southProjected}: The Southern edge of the tile in projected coordinates of the tiling scheme. -
{eastProjected}: The Eastern edge of the tile in projected coordinates of the tiling scheme. -
{northProjected}: The Northern edge of the tile in projected coordinates of the tiling scheme. -
{width}: The width of each tile in pixels. -
{height}: The height of each tile in pixels.
Gets the URL scheme zero padding for each tile coordinate. The format is '000' where each coordinate will be padded on
the left with zeros to match the width of the passed string of zeros. e.g. Setting:
urlSchemeZeroPadding : { '{x}' : '0000'}
will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
其关键词如下:
-
{z}: The zero padding for the level of the tile in the tiling scheme. -
{x}: The zero padding for the tile X coordinate in the tiling scheme. -
{y}: The zero padding for the the tile Y coordinate in the tiling scheme. -
{reverseX}: The zero padding for the tile reverseX coordinate in the tiling scheme. -
{reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme. -
{reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
Methods
getTileCredits(x, y, level) → Array.<Credit>
获得在显示特定瓦片时显示的信用值.
| Name | Type | Description |
|---|---|---|
x |
number | 瓷砖X坐标. |
y |
number | 瓦片Y坐标. |
level |
number | 瓦片级; |
Returns:
显示瓷砖时要显示的信用值 .
pickFeatures(x, y, level, longitude, latitude) → Promise.<Array.<ImageryLayerFeatureInfo>>|undefined
Asynchronously determines what features, if any, are located at a given longitude and latitude within
a tile.
| Name | Type | Description |
|---|---|---|
x |
number | 瓷砖X坐标. |
y |
number | 瓦片Y坐标. |
level |
number | 瓦片级. |
longitude |
number | 选择特征的经度 . |
latitude |
number | 选择特征的纬度. |
Returns:
承诺在同步时解决
picking completes. The resolved value is an array of
ImageryLayerFeatureInfo
实例。 如果在指定位置找不到任何特性, 阵列可能为空 .
如果不支持采摘,它也可能没有定义.
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
NT 0 构造器的初始化选项
{z}: The level of the tile in the tiling scheme. Level zero is the root of the quadtree pyramid.{x}: The tile X coordinate in the tiling scheme, where 0 is the Westernmost tile.{y}: The tile Y coordinate in the tiling scheme, where 0 is the Northernmost tile.{s}: One of the available subdomains, used to overcome browser limits on the number of simultaneous requests per host.{reverseX}: The tile X coordinate in the tiling scheme, where 0 is the Easternmost tile.{reverseY}: The tile Y coordinate in the tiling scheme, where 0 is the Southernmost tile.{reverseZ}: The level of the tile in the tiling scheme, where level zero is the maximum level of the quadtree pyramid. In order to use reverseZ, maximumLevel must be defined.{westDegrees}: The Western edge of the tile in geodetic degrees.{southDegrees}: The Southern edge of the tile in geodetic degrees.{eastDegrees}: The Eastern edge of the tile in geodetic degrees.{northDegrees}: The Northern edge of the tile in geodetic degrees.{westProjected}: The Western edge of the tile in projected coordinates of the tiling scheme.{southProjected}: The Southern edge of the tile in projected coordinates of the tiling scheme.{eastProjected}: The Eastern edge of the tile in projected coordinates of the tiling scheme.{northProjected}: The Northern edge of the tile in projected coordinates of the tiling scheme.{width}: The width of each tile in pixels.{height}: The height of each tile in pixels.{i}: The pixel column (horizontal coordinate) of the picked position, where the Westernmost pixel is 0.{j}: The pixel row (vertical coordinate) of the picked position, where the Northernmost pixel is 0.{reverseI}: The pixel column (horizontal coordinate) of the picked position, where the Easternmost pixel is 0.{reverseJ}: The pixel row (vertical coordinate) of the picked position, where the Southernmost pixel is 0.{longitudeDegrees}: The longitude of the picked position in degrees.{latitudeDegrees}: The latitude of the picked position in degrees.{longitudeProjected}: The longitude of the picked position in the projected coordinates of the tiling scheme.{latitudeProjected}: The latitude of the picked position in the projected coordinates of the tiling scheme.{format}: The format in which to get feature information, as specified in theGetFeatureInfoFormat.-
{z}: The zero padding for the level of the tile in the tiling scheme. -
{x}: The zero padding for the tile X coordinate in the tiling scheme. -
{y}: The zero padding for the the tile Y coordinate in the tiling scheme. -
{reverseX}: The zero padding for the tile reverseX coordinate in the tiling scheme. -
{reverseY}: The zero padding for the tile reverseY coordinate in the tiling scheme. -
{reverseZ}: The zero padding for the reverseZ coordinate of the tile in the tiling scheme.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
url |
Resource | string | The URL template to use to request tiles. It has the following keywords:
|
||
pickFeaturesUrl |
Resource | string |
<optional> |
The URL template to use to pick features. If this property is not specified,
UrlTemplateImageryProvider#pickFeatures will immediately returned undefined, indicating no
选择的特性。 URL 模板支持由 url 1 支持的所有关键词
参数,加上以下:
|
|
urlSchemeZeroPadding |
object |
<optional> |
Gets the URL scheme zero padding for each tile coordinate. The format is '000' where
each coordinate will be padded on the left with zeros to match the width of the passed string of zeros. e.g. Setting:
urlSchemeZeroPadding : { '{x}' : '0000'}
will cause an 'x' value of 12 to return the string '0012' for {x} in the generated URL.
它经过的对象有下列关键词:
|
|
subdomains |
string | Array.<string> |
<optional> |
'abc' | The subdomains to use for the {s} placeholder in the URL template.
如果这个参数是单字符串,字符串中的每个字符都是子域. 如果是的话
一个数组,数组中的每个元素都是子域. |
credit |
Credit | string |
<optional> |
'' | 数据源的信用,在画布上显示. |
minimumLevel |
number |
<optional> |
0 | The minimum level-of-detail supported by the imagery provider. Take care when specifying 表示最低水平的瓦片数量很小,例如四块或四块以下。 数量可能更多 导致产生问题. |
maximumLevel |
number |
<optional> |
图像提供者支持的最大详细水平,或者在没有限制的情况下未定义. | |
rectangle |
Rectangle |
<optional> |
Rectangle.MAX_VALUE | The rectangle, in radians, covered by the image. |
tilingScheme |
TilingScheme |
<optional> |
WebMercatorTilingScheme | The tiling scheme specifying how the ellipsoidal
surface is broken into tiles. If this parameter is not provided, a WebMercatorTilingScheme
is used. |
ellipsoid |
Ellipsoid |
<optional> |
椭圆形. 如果指定了铺设方案, 此参数被忽略, 并使用平面图的椭圆形 。 如果没有 参数指定,使用 NT 0 椭圆. | |
tileWidth |
number |
<optional> |
256 | |
tileHeight |
number |
<optional> |
256 | |
hasAlphaChannel |
boolean |
<optional> |
true | true if the images provided by this imagery provider 包括一个α通道;否则,是虚假的。 如果此属性是虚假的, 是一个α通道, 如果 现在,将被忽略。 如果此属性属实, 没有 Alpha 通道的任何图像都会 他们的α是1.0 到处都是。 当此属性为虚假时, 内存使用 而纹理上传时间可能缩短. |
getFeatureInfoFormats |
Array.<GetFeatureInfoFormat> |
<optional> |
获取专题信息的格式
specific location when UrlTemplateImageryProvider#pickFeatures is invoked. If this
未指定参数, 特性选择被禁用 . |
|
enablePickFeatures |
boolean |
<optional> |
true | If true, UrlTemplateImageryProvider#pickFeatures will
request the pickFeaturesUrl and attempt to interpret the features included in the response. If false,
UrlTemplateImageryProvider#pickFeatures will immediately return undefined (indicating no pickable
特性),不与服务器通信. 如果您知道您的数据, 请将此属性设定为虚假
来源不支持选择特性, 或者如果您不希望此提供者的特性可以选择 。 说明
that this can be dynamically overridden by modifying the UriTemplateImageryProvider#enablePickFeatures
property. |
tileDiscardPolicy |
TileDiscardPolicy |
<optional> |
根据一些标准丢弃瓦片图像的政策 | |
customTags |
object |
<optional> |
允许在 NT 0 模板中替换自定义关键词. 对象必须有字符串作为键,函数作为值. |