Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -14,20 +14,20 @@ import {appendParams} from '../uri.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
|
||||
* @property {import("./Source.js").AttributionLike} [attributions] Attributions.
|
||||
* @property {number} [cacheSize=2048] Cache size.
|
||||
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
|
||||
* you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to
|
||||
* access pixel data with the Canvas renderer. See
|
||||
* https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
|
||||
* @property {module:ol/tilegrid/WMTS} tileGrid Tile grid.
|
||||
* @property {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @property {import("../tilegrid/WMTS.js").default} tileGrid Tile grid.
|
||||
* @property {import("../proj.js").ProjectionLike} projection Projection.
|
||||
* @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
|
||||
* Higher values can increase reprojection performance, but decrease precision.
|
||||
* @property {module:ol/source/WMTSRequestEncoding|string} [requestEncoding='KVP'] Request encoding.
|
||||
* @property {import("./WMTSRequestEncoding.js").default|string} [requestEncoding='KVP'] Request encoding.
|
||||
* @property {string} layer Layer name as advertised in the WMTS capabilities.
|
||||
* @property {string} style Style name as advertised in the WMTS capabilities.
|
||||
* @property {module:ol/ImageTile~TileClass} [tileClass] Class used to instantiate image tiles. Default is {@link module:ol/ImageTile~ImageTile}.
|
||||
* @property {import("../ImageTile.js").TileClass} [tileClass] Class used to instantiate image tiles. Default is {@link module:ol/ImageTile~ImageTile}.
|
||||
* @property {number} [tilePixelRatio=1] The pixel ratio used by the tile service.
|
||||
* For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px
|
||||
* by 512px images (for retina/hidpi devices) then `tilePixelRatio`
|
||||
@@ -42,7 +42,7 @@ import {appendParams} from '../uri.js';
|
||||
* template. For KVP encoding, it is normal URL. A `{?-?}` template pattern,
|
||||
* for example `subdomain{a-f}.domain.com`, may be used instead of defining
|
||||
* each one separately in the `urls` option.
|
||||
* @property {module:ol/Tile~LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is
|
||||
* @property {import("../Tile.js").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. The default is
|
||||
* ```js
|
||||
* function(imageTile, src) {
|
||||
* imageTile.getImage().src = src;
|
||||
@@ -63,14 +63,14 @@ import {appendParams} from '../uri.js';
|
||||
*/
|
||||
class WMTS extends TileImage {
|
||||
/**
|
||||
* @param {module:ol/source/WMTS~Options=} options WMTS options.
|
||||
* @param {Options=} options WMTS options.
|
||||
*/
|
||||
constructor(options) {
|
||||
|
||||
// TODO: add support for TileMatrixLimits
|
||||
|
||||
const requestEncoding = options.requestEncoding !== undefined ?
|
||||
/** @type {module:ol/source/WMTSRequestEncoding} */ (options.requestEncoding) :
|
||||
/** @type {import("./WMTSRequestEncoding.js").default} */ (options.requestEncoding) :
|
||||
WMTSRequestEncoding.KVP;
|
||||
|
||||
// FIXME: should we create a default tileGrid?
|
||||
@@ -139,7 +139,7 @@ class WMTS extends TileImage {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/source/WMTSRequestEncoding}
|
||||
* @type {import("./WMTSRequestEncoding.js").default}
|
||||
*/
|
||||
this.requestEncoding_ = requestEncoding;
|
||||
|
||||
@@ -208,7 +208,7 @@ class WMTS extends TileImage {
|
||||
|
||||
/**
|
||||
* Return the request encoding, either "KVP" or "REST".
|
||||
* @return {module:ol/source/WMTSRequestEncoding} Request encoding.
|
||||
* @return {import("./WMTSRequestEncoding.js").default} Request encoding.
|
||||
* @api
|
||||
*/
|
||||
getRequestEncoding() {
|
||||
@@ -285,7 +285,7 @@ export default WMTS;
|
||||
* - format - {string} Image format for the layer. Default is the first
|
||||
* format returned in the GetCapabilities response.
|
||||
* - crossOrigin - {string|null|undefined} Cross origin. Default is `undefined`.
|
||||
* @return {?module:ol/source/WMTS~Options} WMTS source options object or `null` if the layer was not found.
|
||||
* @return {?Options} WMTS source options object or `null` if the layer was not found.
|
||||
* @api
|
||||
*/
|
||||
export function optionsFromCapabilities(wmtsCap, config) {
|
||||
@@ -459,8 +459,8 @@ export function optionsFromCapabilities(wmtsCap, config) {
|
||||
|
||||
/**
|
||||
* @param {string} template Template.
|
||||
* @return {module:ol/Tile~UrlFunction} Tile URL function.
|
||||
* @this {module:ol/source/WMTS}
|
||||
* @return {import("../Tile.js").UrlFunction} Tile URL function.
|
||||
* @this {import("./WMTS.js").default}
|
||||
*/
|
||||
function createFromWMTSTemplate(template) {
|
||||
const requestEncoding = this.requestEncoding_;
|
||||
@@ -497,9 +497,9 @@ function createFromWMTSTemplate(template) {
|
||||
|
||||
return (
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/proj/Projection} projection Projection.
|
||||
* @param {import("../proj/Projection.js").default} projection Projection.
|
||||
* @return {string|undefined} Tile URL.
|
||||
*/
|
||||
function(tileCoord, pixelRatio, projection) {
|
||||
|
||||
Reference in New Issue
Block a user