Class: TileGrid

ol.tilegrid.TileGrid

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

new ol.tilegrid.TileGrid(options)

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 should match the resolutions array, i.e. each resolution can have a different origin.

resolutions Array.<number>

Resolutions.

tileSize number | undefined

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

tileSizes Array.<number> | undefined

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

Subclasses

Methods

getMaxZoom(){number} experimental

Returns:
Max zoom.

getMinZoom(){number} experimental

Returns:
Min zoom.
Name Type Description
z number

Z.

Returns:
Origin.

getResolution(z){number}

Name Type Description
z number

Z.

Returns:
Resolution.

getResolutions(){Array.<number>}

Returns:
Resolutions.

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

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

Name Type Description
coordinate ol.Coordinate

Coordinate.

z number

Z.

tileCoord ol.TileCoord

Destination ol.TileCoord object.

Returns:
Tile coordinate.

getTileSize(z){number}

Name Type Description
z number

Z.

Returns:
Tile size.