Class: WMTS

ol.tilegrid.WMTS

Set the grid pattern for sources accessing WMTS tiled-image servers.

new ol.tilegrid.WMTS(options) experimental

src/ol/tilegrid/wmtstilegrid.js, line 20
Name Type Description
options

WMTS options.

Name Type Description
extent ol.Extent | undefined experimental

Extent for the tile grid. No tiles outside this extent will be requested by ol.source.WMTS sources. When no origin or origins are configured, the origin will be calculated from the extent. When no sizes are configured, they will be calculated from the extent.

origin ol.Coordinate | undefined experimental

Origin, i.e. the top-left corner of the grid.

origins Array.<ol.Coordinate> | undefined experimental

Origins, i.e. the top-left corners of the grid for each zoom level. The length of this array needs to match the length of the resolutions array.

resolutions Array.<number> experimental

Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a minZoom is configured, the resolutions array will have a length of maxZoom + 1

matrixIds Array.<string> experimental

matrix IDs. The length of this array needs to match the length of the resolutions array.

sizes Array.<ol.Size> | undefined experimental

Number of tile rows and columns of the grid for each zoom level. The values here are the TileMatrixWidth and TileMatrixHeight advertised in the GetCapabilities response of the WMTS, and define the grid's extent together with the origin. An extent can be configured in addition, and will further limit the extent for which tile requests are made by sources.

tileSize number | ol.Size | undefined experimental

Tile size.

tileSizes Array.<(number|ol.Size)> | undefined experimental

Tile sizes. The length of this array needs to match the length of the resolutions array.

widths Array.<number> | undefined experimental

Number of tile columns that cover the grid's extent for each zoom level. Only required when used with a source that has wrapX set to true, and only when the grid's origin differs from the one of the projection's extent. The array length has to match the length of the resolutions array, i.e. each resolution will have a matching entry here.

Extends

Members

createTileCoordTransform experimental

Creates a TileCoord transform function for use with this tile grid. Transforms the internal tile coordinates with bottom-left origin to the tile coordinates used by the ol.TileUrlFunction. The returned function expects an ol.TileCoord as first and an ol.proj.Projection as second argument and returns a transformed ol.TileCoord.

Methods

ol.tilegrid.WMTS.createFromCapabilitiesMatrixSet(matrixSet, opt_extent){ol.tilegrid.WMTS} experimental

src/ol/tilegrid/wmtstilegrid.js, line 78

Create a tile grid from a WMTS capabilities matrix set.

Name Type Description
matrixSet Object

An object representing a matrixSet in the capabilities document.

extent ol.Extent

An optional extent to restrict the tile ranges the server provides.

Returns:
WMTS tileGrid instance.

getMatrixIds(){Array.<string>} experimental

src/ol/tilegrid/wmtstilegrid.js, line 64

Get the list of matrix identifiers.

Returns:
MatrixIds.

getMaxZoom(){number} inherited experimental

src/ol/tilegrid/tilegrid.js, line 214

Get the maximum zoom level for the grid.

Returns:
Max zoom.

getMinZoom(){number} inherited experimental

src/ol/tilegrid/tilegrid.js, line 224

Get the minimum zoom level for the grid.

Returns:
Min zoom.

getOrigin(z){ol.Coordinate} inherited

src/ol/tilegrid/tilegrid.js, line 235

Get the origin for the grid at the given zoom level.

Name Type Description
z number

Z.

Returns:
Origin.

getResolution(z){number} inherited

src/ol/tilegrid/tilegrid.js, line 255

Get the resolution for the given zoom level.

Name Type Description
z number

Z.

Returns:
Resolution.

getResolutions(){Array.<number>} inherited

src/ol/tilegrid/tilegrid.js, line 268

Get the list of resolutions for the tile grid.

Returns:
Resolutions.

getTileCoordForCoordAndResolution(coordinate, resolution, opt_tileCoord){ol.TileCoord} inherited experimental

src/ol/tilegrid/tilegrid.js, line 388

Get the tile coordinate for the given map coordinate and resolution. This method considers that coordinates that intersect tile boundaries should be assigned the higher tile coordinate.

Name Type Description
coordinate ol.Coordinate

Coordinate.

resolution number

Resolution.

tileCoord ol.TileCoord

Destination ol.TileCoord object.

Returns:
Tile coordinate.

getTileCoordForCoordAndZ(coordinate, z, opt_tileCoord){ol.TileCoord} inherited experimental

src/ol/tilegrid/tilegrid.js, line 439

Get a tile coordinate given a map coordinate and zoom level.

Name Type Description
coordinate ol.Coordinate

Coordinate.

z number

Zoom level.

tileCoord ol.TileCoord

Destination ol.TileCoord object.

Returns:
Tile coordinate.

getTileSize(z){number|ol.Size} inherited

src/ol/tilegrid/tilegrid.js, line 468

Get the tile size for a zoom level. The type of the return value matches the tileSize or tileSizes that the tile grid was configured with. To always get an ol.Size, run the result through ol.size.toSize().

Name Type Description
z number

Z.

Returns:
Tile size.