Class: WMTS

ol/source/WMTS~WMTS


import WMTS from 'ol/source/WMTS';

Layer source for tile data from WMTS servers.

new WMTS(options)

source/WMTS.js, line 64
Name Type Description
options

WMTS options.

Name Type Default Description
attributions module:ol/source/Source~AttributionLike

Attributions.

cacheSize number 2048

Cache size.

crossOrigin null | string

The crossOrigin attribute for loaded images. Note that you must provide a crossOrigin value if you are using the WebGL renderer or if you want to access pixel data with the Canvas renderer. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.

tileGrid module:ol/tilegrid/WMTS~WMTSTileGrid

Tile grid.

projection module:ol/proj~ProjectionLike

Projection.

reprojectionErrorThreshold number 0.5

Maximum allowed reprojection error (in pixels). Higher values can increase reprojection performance, but decrease precision.

requestEncoding module:ol/source/WMTSRequestEncoding | string 'KVP'

Request encoding.

layer string

Layer name as advertised in the WMTS capabilities.

style string

Style name as advertised in the WMTS capabilities.

tileClass module:ol/ImageTile~TileClass

Class used to instantiate image tiles. Default is module:ol/ImageTile~ImageTile.

tilePixelRatio number 1

The pixel ratio used by the tile service. For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px by 512px images (for retina/hidpi devices) then tilePixelRatio should be set to 2.

version string 'image/jpeg'

Image format.

format string '1.0.0'

WMTS version.

matrixSet string

Matrix set.

dimensions Object

Additional "dimensions" for tile requests. This is an object with properties named like the advertised WMTS dimensions.

url string

A URL for the service. For the RESTful request encoding, this is a URL template. For KVP encoding, it is normal URL. A {?-?} template pattern, for example subdomain{a-f}.domain.com, may be used instead of defining each one separately in the urls option.

tileLoadFunction module:ol/Tile~LoadFunction

Optional function to load a tile given a URL. The default is

function(imageTile, src) {
  imageTile.getImage().src = src;
};
urls Array.<string>

An array of URLs. Requests will be distributed among the URLs in this array.

wrapX boolean false

Whether to wrap the world horizontally.

transition number

Duration of the opacity transition for rendering. To disable the opacity transition, pass transition: 0.

Methods

getDimensions(){Object}

source/WMTS.js, line 174

Get the dimensions, i.e. those passed to the constructor through the "dimensions" option, and possibly updated using the updateDimensions method.

Returns:
Dimensions.

getFormat(){string}

source/WMTS.js, line 184

Return the image format of the WMTS source.

Returns:
Format.

getLayer(){string}

source/WMTS.js, line 194

Return the layer of the WMTS source.

Returns:
Layer.

getMatrixSet(){string}

source/WMTS.js, line 204

Return the matrix set of the WMTS source.

Returns:
MatrixSet.

getRequestEncoding(){module:ol/source/WMTSRequestEncoding}

source/WMTS.js, line 214

Return the request encoding, either "KVP" or "REST".

Returns:
Request encoding.

getStyle(){string}

source/WMTS.js, line 224

Return the style of the WMTS source.

Returns:
Style.

getVersion(){string}

source/WMTS.js, line 234

Return the version of the WMTS source.

Returns:
Version.

updateDimensions(dimensions)

source/WMTS.js, line 258

Update the dimensions.

Name Type Description
dimensions Object

Dimensions.