-
Name Type Description extentExtent | undefined Extent for the tile grid. No tiles outside this extent will be requested by
TileSourcesources. When nooriginororiginsare configured, theoriginwill be set to the top-left corner of the extent.minZoomnumber (defaults to 0) Minimum zoom.
originCoordinate | undefined The tile grid origin, i.e. where the
xandyaxes meet ([z, 0, 0]). Tile coordinates increase left to right and downwards. If not specified,extentororiginsmust be provided.originsArray<Coordinate> | undefined Tile grid origins, i.e. where the
xandyaxes meet ([z, 0, 0]), for each zoom level. If given, the array length should match the length of theresolutionsarray, i.e. each resolution can have a different origin. Tile coordinates increase left to right and downwards. If not specified,extentororiginmust be provided.resolutionsArray.<number> Resolutions. The array index of each resolution needs to match the zoom level. This means that even if a
minZoomis configured, the resolutions array will have a length ofmaxZoom + 1.sizesArray<Size> | undefined Number of tile rows and columns of the grid for each zoom level. If specified the values define each zoom level's extent together with the
originororigins. A gridextentcan be configured in addition, and will further limit the extent for which tile requests are made by sources. If the bottom-left corner of an extent is used asoriginororigins, then theyvalue must be negative because OpenLayers tile coordinates use the top left as the origin.tileSizenumber | Size | undefined Tile size. Default is
[256, 256].tileSizesArray.<(number|module:ol/size~Size)> | undefined Tile sizes. If given, the array length should match the length of the
resolutionsarray, i.e. each resolution can have a different tile size.
Subclasses
Methods
-
Call a function with each tile coordinate for a given extent and zoom level.
Name Type Description extentExtent Extent.
zoomnumber Integer zoom level.
callbackfunction Function called with each tile coordinate.
-
Get the extent for this tile grid, if it was configured.
Returns:
Extent.
-
Get the maximum zoom level for the grid.
Returns:
Max zoom.
-
Get the minimum zoom level for the grid.
Returns:
Min zoom.
-
Get the origin for the grid at the given zoom level.
Name Type Description znumber Integer zoom level.
Returns:
Origin.
-
Get the resolution for the given zoom level.
Name Type Description znumber Integer zoom level.
Returns:
Resolution.
-
Get the list of resolutions for the tile grid.
Returns:
Resolutions.
-
Get the extent of a tile coordinate.
Name Type Description tileCoordTileCoord Tile coordinate.
tempExtentExtent | undefined Temporary extent object.
Returns:
Extent.
-
getTileCoordForCoordAndResolution(coordinate, resolution, opt_tileCoord){TileCoord}
-
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 coordinateCoordinate Coordinate.
resolutionnumber Resolution.
opt_tileCoordTileCoord | undefined Destination module:ol/tilecoord~TileCoord object.
Returns:
Tile coordinate.
-
Get a tile coordinate given a map coordinate and zoom level.
Name Type Description coordinateCoordinate Coordinate.
znumber Integer zoom level, e.g. the result of a
getZForResolution()method callopt_tileCoordTileCoord | undefined Destination module:ol/tilecoord~TileCoord object.
Returns:
Tile coordinate.
-
Get the tile size for a zoom level. The type of the return value matches the
tileSizeortileSizesthat the tile grid was configured with. To always get anSize, run the result throughtoSize.Name Type Description znumber Z.
Returns:
Tile size.
-
Name Type Description resolutionnumber Resolution.
opt_directionnumber | NearestDirectionFunction | undefined If 0, the nearest resolution will be used. If 1, the nearest higher resolution (lower Z) will be used. If -1, the nearest lower resolution (higher Z) will be used. Default is 0. Use a
NearestDirectionFunctionfor more precise control.For example to change tile Z at the midpoint of zoom levels
function(value, high, low) { return value - low * Math.sqrt(high / low); }Returns:
Z.