WMTSTileGrid
参数:
Name | Type | Description |
---|---|---|
extent | Extent | undefined | 瓦片网格的范围 |
origin | Coordinate | undefined | 瓦片网格的原点 |
origins | Array<Coordinate> | undefined | Tile grid origins, i.e. where the |
resolutions | Array.<number> | 每个分辨率的数组索引需要匹配缩放级别 |
matrixIds | Array.<string> | 矩阵id(对应每个分辨率的瓦片数组)。 这个数组的长度需要与resolution数组的长度匹配。 |
sizes | Array<Size> | undefined | Number of tile rows and columns of the grid for each zoom level. The values here are the |
tileSize | number | Size | undefined | Tile size. |
tileSizes | Array.<(number|module:ol/size~Size)> | undefined | Tile sizes. T |
实例:
// create the WMTS tile grid in the google projection
const projection = getProjection('EPSG:3857');
const tileSizePixels = 256;
const tileSizeMtrs = getWidth(projection.getExtent()) / tileSizePixels;
const matrixIds = [];
const resolutions = [];
for (let i = 0; i <= 14; i++) {
matrixIds[i] = i;
resolutions[i] = tileSizeMtrs / Math.pow(2, i);
}
const tileGrid = new WMTSTileGrid({
origin: getTopLeft(projection.getExtent()),
resolutions: resolutions,
matrixIds: matrixIds,
});