import { TileMatrixSetType, TileMatrixType } from '@linzjs/tile-matrix-set'; import { Bounds, Point } from './bounds.js'; import { Epsg } from './epsg.js'; export type Tile = Point & { z: number; }; export type Axis = 'Y' | 'X'; export type AxisOrder = { orderedAxes: [Axis, Axis]; }; export type TileMatrixSetTypeOrdered = TileMatrixSetType & AxisOrder; export declare class TileMatrixSet { /** Projection of the matrix set */ projection: Epsg; /** Number of pixels for a tile */ tileHeight: number; tileWidth: number; /** * Raw tile matrix definition * * Avoid directly accessing this object */ readonly def: TileMatrixSetType; /** Indexed tile index zooms */ readonly zooms: TileMatrixType[]; /** Array index of X coordinates */ indexX: number; /** Array index of y coordinate */ indexY: number; /** The full extent (boundingBox) from the TileMatrixSetType definition */ readonly extent: Bounds; /** * Create using a WMTS EPSG definition * @param def */ constructor(def: TileMatrixSetType); /** * Maximum zoom level * Valid zoom levels are 0 - maxZoom (inclusive) */ get maxZoom(): number; /** * Unique identifier of the TileMatrix {@link TileMatrixSetType.identifier} * * @example * "WebMercatorQuad" * "NZTM2000Quad" */ get identifier(): string; /** * http://docs.opengeospatial.org/is/17-083r2/17-083r2.html#table_2: * The pixel size of the tile can be obtained from the scaleDenominator by * multiplying the later by 0.28 10-3 / metersPerUnit */ static ScaleDenominatorRatio: number; /** Get the pixels / meter at a specified zoom level */ pixelScale(zoom: number): number; tileToPixels(tX: number, tY: number): Point; /** * Convert a pixel point into tile offset * * @param pX pixel X offset * @param pY pixel Y offset * @param zoom pixel zoom level */ pixelsToTile(pX: number, pY: number, zoom: number): Tile; /** * Convert a XYZ tile into the raster bounds for the tile * * @param tX tile X offset * @param tY tile Y offset * @param zoom tile zoom level */ sourceToPixels(sX: number, sY: number, zoom: number): Point; /** * Convert a pixel offset into source units () * @param pX pixel X offset * @param pY pixel Y offset * @param zoom pixel zoom level */ pixelsToSource(pX: number, pY: number, zoom: number): Point; /** * Get the source units for a `tile` upper left point */ tileToSource(tile: Tile): Point; /** * Get the boundingBox for a `tile` in source units */ tileToSourceBounds(tile: Tile): Bounds; /** * Iterate over the top level tiles that cover the extent of the `TileMatrixSet` */ topLevelTiles(): Generator; /** * Iterate over the child (`z+1`) tiles that cover `tile` * @param tile */ coverTile(tile?: Tile): Generator; /** * Make a name for a `tile` */ static tileToName(tile: Tile): string; /** * Convert `name` to a `tile` */ static nameToTile(name: string): Tile; /** Mapping of scaleFactor to closet scaleFactor */ private zoomConversionMap; /** * Find the closest matching zoom to the given scale * @param scaleDenominator scale to match * @returns the zoom level of the closest matching zoom */ findBestZoom(scaleDenominator: number): number; private convertZoomLevel; /** * Convert a given zoom level from one tile matrix to another * @param z Zoom to convert * @param from Tile matrix to convert from * @param to Tile matrix to convert to * @param mapMinMax Should the min (0) and max be converted directly across, * for example if from.maxZoom = 10 and to.maxZoom = 30, when z is 10 it will always return 30, even if there are other scales that would match * @returns converted zoom level */ static convertZoomLevel(z: number, from: TileMatrixSet, to: TileMatrixSet, mapMinMax?: boolean): number; }