Classes
函数s
-
import {optionsFromCapabilities} from 'ol/source/WMTS';从能力对象生成数据源选项。
Name Type Description wmtsCapObject 表示能力文档的对象。
configObject 图层的配置属性。如果未提供,将使用图层的默认值。
必需的配置属性:
- layer - {string} The layer identifier.
可选的配置属性:
- matrixSet - {string} The matrix set identifier, required if there is more than one matrix set in the layer capabilities.
- projection - {string} The desired CRS when no matrixSet is specified. eg: "EPSG:3857". If the desired projection is not available, an error is thrown.
- requestEncoding - {string} url encoding format for the layer. Default is the first tile url format found in the GetCapabilities response.
- style - {string} The name of the style
- format - {string} Image format for the layer. Default is the first format returned in the GetCapabilities response.
- crossOrigin - {string|null|undefined} Cross origin. Default is
undefined.
返回值:
WMTS source options object ornullif the layer was not found.
Type Definitions
-
Options{Object}
-
Properties:
Name Type Description attributionsAttributionLike | undefined 归属信息。
attributionsCollapsibleboolean
(defaults to true)归属信息是否可折叠。
cacheSizenumber | undefined 已弃用。 请改用图层上的 cacheSize 选项。
crossOriginnull | string | undefined 已加载图像的 crossOrigin 属性。注意如果要使用 Canvas 渲染器访问像素数据,必须提供 crossOrigin 值。详见 https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image。 referrerPolicyReferrerPolicy | undefined 已加载图像的
referrerPolicy属性。interpolateboolean
(defaults to true)重采样时是否使用插值。默认情况下, 重采样时使用线性插值。设置为 false 可使用 the nearest neighbor instead.
tileGridWMTSTileGrid 瓦片网格。
projectionProjectionLike | undefined 投影。默认为视图投影。
reprojectionErrorThresholdnumber
(defaults to 0.5)允许的最大重投影误差(以像素为单位)。 值越高可以提高重投影性能,但会降低精度。
requestEncodingRequestEncoding
(defaults to 'KVP')请求编码。
layerstring WMTS 能力中公布的图层名称。
stylestring WMTS 能力中公布的样式名称。
tileClassClass<ImageTile> | undefined 用于实例化图像瓦片的类。默认为
ImageTile。tilePixelRationumber
(defaults to 1)瓦片服务使用的像素比。例如,如果瓦片服务宣传 256x256 像素瓦片但实际发送 512x512 像素图像(用于 retina/hidpi 设备),则
tilePixelRatio应设置为2。formatstring
(defaults to 'image/jpeg')图像格式。仅在
requestEncoding为'KVP'时使用。versionstring
(defaults to '1.0.0')WMTS 版本。
matrixSetstring 矩阵集。
dimensionsObject | undefined 瓦片请求的额外"维度"。这是一个对象,其属性名称与公布的 WMTS 维度相同。
urlstring | undefined 服务的 URL。对于 RESTful 请求编码,这是一个 URL 模板。对于 KVP 编码,这是一个普通 URL。可以使用
{?-?}模板模式(例如subdomain{a-f}.domain.com)来代替在urls选项中逐个定义。tileLoad函数Load函数 | undefined 给定 URL 加载瓦片的可选函数。默认为
function(imageTile, src) { imageTile.getImage().src = src; };urlsArray.<string> | undefined URL 数组。请求将在此数组中的 URL 之间分配。
wrapXboolean
(defaults to false)是否水平环绕世界。
transitionnumber | undefined 渲染的不透明度过渡持续时间。要禁用不透明度过渡,请传递
transition: 0。zDirectionnumber | NearestDirection函数
(defaults to 0)选择在整数缩放级别之间使用更高还是更低缩放级别的瓦片。参见
getZForResolution。 -
RequestEncoding{'KVP'} {'REST'}
-
请求编码。可选值为 'KVP'、'REST'。