Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -12,8 +12,8 @@ import TileGrid from './tilegrid/TileGrid.js';
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @return {!module:ol/tilegrid/TileGrid} Default tile grid for the
|
||||
* @param {import("./proj/Projection.js").default} projection Projection.
|
||||
* @return {!import("./tilegrid/TileGrid.js").default} Default tile grid for the
|
||||
* passed projection.
|
||||
*/
|
||||
export function getForProjection(projection) {
|
||||
@@ -27,10 +27,10 @@ export function getForProjection(projection) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/tilegrid/TileGrid} tileGrid Tile grid.
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @return {module:ol/tilecoord~TileCoord} Tile coordinate.
|
||||
* @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid.
|
||||
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||
* @param {import("./proj/Projection.js").default} projection Projection.
|
||||
* @return {import("./tilecoord.js").TileCoord} Tile coordinate.
|
||||
*/
|
||||
export function wrapX(tileGrid, tileCoord, projection) {
|
||||
const z = tileCoord[0];
|
||||
@@ -48,13 +48,13 @@ export function wrapX(tileGrid, tileCoord, projection) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number=} opt_maxZoom Maximum zoom level (default is
|
||||
* DEFAULT_MAX_ZOOM).
|
||||
* @param {number|module:ol/size~Size=} opt_tileSize Tile size (default uses
|
||||
* @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses
|
||||
* DEFAULT_TILE_SIZE).
|
||||
* @param {module:ol/extent/Corner=} opt_corner Extent corner (default is `'top-left'`).
|
||||
* @return {!module:ol/tilegrid/TileGrid} TileGrid instance.
|
||||
* @param {import("./extent/Corner.js").default=} opt_corner Extent corner (default is `'top-left'`).
|
||||
* @return {!import("./tilegrid/TileGrid.js").default} TileGrid instance.
|
||||
*/
|
||||
export function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) {
|
||||
const corner = opt_corner !== undefined ? opt_corner : Corner.TOP_LEFT;
|
||||
@@ -72,26 +72,26 @@ export function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) {
|
||||
|
||||
/**
|
||||
* @typedef {Object} XYZOptions
|
||||
* @property {module:ol/extent~Extent} [extent] Extent for the tile grid. The origin for an XYZ tile grid is the
|
||||
* @property {import("./extent.js").Extent} [extent] Extent for the tile grid. The origin for an XYZ tile grid is the
|
||||
* top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the
|
||||
* provided extent. If not provided, the extent of the EPSG:3857 projection is used.
|
||||
* @property {number} [maxZoom] Maximum zoom. The default is `42`. This determines the number of levels
|
||||
* in the grid set. For example, a `maxZoom` of 21 means there are 22 levels in the grid set.
|
||||
* @property {number} [minZoom=0] Minimum zoom.
|
||||
* @property {number|module:ol/size~Size} [tileSize=[256, 256]] Tile size in pixels.
|
||||
* @property {number|import("./size.js").Size} [tileSize=[256, 256]] Tile size in pixels.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Creates a tile grid with a standard XYZ tiling scheme.
|
||||
* @param {module:ol/tilegrid~XYZOptions=} opt_options Tile grid options.
|
||||
* @return {!module:ol/tilegrid/TileGrid} Tile grid instance.
|
||||
* @param {XYZOptions=} opt_options Tile grid options.
|
||||
* @return {!import("./tilegrid/TileGrid.js").default} Tile grid instance.
|
||||
* @api
|
||||
*/
|
||||
export function createXYZ(opt_options) {
|
||||
const options = /** @type {module:ol/tilegrid/TileGrid~Options} */ ({});
|
||||
const options = /** @type {import("./tilegrid/TileGrid.js").Options} */ ({});
|
||||
assign(options, opt_options !== undefined ?
|
||||
opt_options : /** @type {module:ol/tilegrid~XYZOptions} */ ({}));
|
||||
opt_options : /** @type {XYZOptions} */ ({}));
|
||||
if (options.extent === undefined) {
|
||||
options.extent = getProjection('EPSG:3857').getExtent();
|
||||
}
|
||||
@@ -105,10 +105,10 @@ export function createXYZ(opt_options) {
|
||||
|
||||
/**
|
||||
* Create a resolutions array from an extent. A zoom factor of 2 is assumed.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("./extent.js").Extent} extent Extent.
|
||||
* @param {number=} opt_maxZoom Maximum zoom level (default is
|
||||
* DEFAULT_MAX_ZOOM).
|
||||
* @param {number|module:ol/size~Size=} opt_tileSize Tile size (default uses
|
||||
* @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses
|
||||
* DEFAULT_TILE_SIZE).
|
||||
* @return {!Array<number>} Resolutions array.
|
||||
*/
|
||||
@@ -134,13 +134,13 @@ function resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @param {import("./proj.js").ProjectionLike} projection Projection.
|
||||
* @param {number=} opt_maxZoom Maximum zoom level (default is
|
||||
* DEFAULT_MAX_ZOOM).
|
||||
* @param {number|module:ol/size~Size=} opt_tileSize Tile size (default uses
|
||||
* @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses
|
||||
* DEFAULT_TILE_SIZE).
|
||||
* @param {module:ol/extent/Corner=} opt_corner Extent corner (default is `'top-left'`).
|
||||
* @return {!module:ol/tilegrid/TileGrid} TileGrid instance.
|
||||
* @param {import("./extent/Corner.js").default=} opt_corner Extent corner (default is `'top-left'`).
|
||||
* @return {!import("./tilegrid/TileGrid.js").default} TileGrid instance.
|
||||
*/
|
||||
export function createForProjection(projection, opt_maxZoom, opt_tileSize, opt_corner) {
|
||||
const extent = extentFromProjection(projection);
|
||||
@@ -151,8 +151,8 @@ export function createForProjection(projection, opt_maxZoom, opt_tileSize, opt_c
|
||||
/**
|
||||
* Generate a tile grid extent from a projection. If the projection has an
|
||||
* extent, it is used. If not, a global extent is assumed.
|
||||
* @param {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @param {import("./proj.js").ProjectionLike} projection Projection.
|
||||
* @return {import("./extent.js").Extent} Extent.
|
||||
*/
|
||||
export function extentFromProjection(projection) {
|
||||
projection = getProjection(projection);
|
||||
|
||||
Reference in New Issue
Block a user