Class: TileGrid

ol.tilegrid.TileGrid

Base class for setting the grid pattern for sources accessing tiled-image servers.

new ol.tilegrid.TileGrid(options)

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

Tile grid options.

Name Type Description
minZoom number | undefined experimental

Minimum zoom. Default is 0.

origin ol.Coordinate | undefined

Origin. Default is null.

origins Array.<ol.Coordinate> | undefined

Origins. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different origin.

resolutions Array.<number>

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.

tileSize number | undefined

Tile size. Default is 256. (Only square tiles are supported.)

tileSizes Array.<number> | undefined

Tile sizes. If given, the array length should match the length of the resolutions array, i.e. each resolution can have a different tile size.

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.

Subclasses

Methods

getMaxZoom(){number} experimental

src/ol/tilegrid/tilegrid.js, line 155
Returns:
Max zoom.

getMinZoom(){number} experimental

src/ol/tilegrid/tilegrid.js, line 164
Returns:
Min zoom.

getOrigin(z){ol.Coordinate}

src/ol/tilegrid/tilegrid.js, line 174
Name Type Description
z number

Z.

Returns:
Origin.

getResolution(z){number}

src/ol/tilegrid/tilegrid.js, line 190
Name Type Description
z number

Z.

Returns:
Resolution.

getResolutions(){Array.<number>}

src/ol/tilegrid/tilegrid.js, line 200
Returns:
Resolutions.

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

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

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} experimental

src/ol/tilegrid/tilegrid.js, line 367
Name Type Description
coordinate ol.Coordinate

Coordinate.

z number

Z.

tileCoord ol.TileCoord

Destination ol.TileCoord object.

Returns:
Tile coordinate.

getTileSize(z){number}

src/ol/tilegrid/tilegrid.js, line 410
Name Type Description
z number

Z.

Returns:
Tile size.