diff --git a/externs/olx.js b/externs/olx.js index a0c9fa7dbb..fa20fd9235 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -290,116 +290,6 @@ olx.source.TileArcGISRestOptions.prototype.transition; olx.source.TileArcGISRestOptions.prototype.urls; -/** - * @typedef {{attributions: (ol.AttributionLike|undefined), - * cacheSize: (number|undefined), - * crossOrigin: (null|string|undefined), - * jsonp: (boolean|undefined), - * reprojectionErrorThreshold: (number|undefined), - * tileJSON: (TileJSON|undefined), - * tileLoadFunction: (ol.TileLoadFunctionType|undefined), - * url: (string|undefined), - * wrapX: (boolean|undefined), - * transition: (number|undefined)}} - */ -olx.source.TileJSONOptions; - - -/** - * Optional attributions for the source. If provided, these will be used - * instead of any attribution data advertised by the server. If not provided, - * any attributions advertised by the server will be used. - * @type {ol.AttributionLike|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.attributions; - - -/** - * Cache size. Default is `2048`. - * @type {number|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.cacheSize; - - -/** - * 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 - * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} - * for more detail. - * @type {null|string|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.crossOrigin; - - -/** - * Use JSONP with callback to load the TileJSON. Useful when the server - * does not support CORS. Default is `false`. - * @type {boolean|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.jsonp; - - -/** - * Maximum allowed reprojection error (in pixels). Default is `0.5`. - * Higher values can increase reprojection performance, but decrease precision. - * @type {number|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.reprojectionErrorThreshold; - - -/** - * TileJSON configuration for this source. If not provided, `url` must be - * configured. - * @type {TileJSON|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.tileJSON; - - -/** - * Optional function to load a tile given a URL. The default is - * ```js - * function(imageTile, src) { - * imageTile.getImage().src = src; - * }; - * ``` - * @type {ol.TileLoadFunctionType|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.tileLoadFunction; - - -/** - * URL to the TileJSON file. If not provided, `tileJSON` must be configured. - * @type {string|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.url; - - -/** - * Whether to wrap the world horizontally. Default is `true`. - * @type {boolean|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.wrapX; - - -/** - * Duration of the opacity transition for rendering. To disable the opacity - * transition, pass `transition: 0`. - * @type {number|undefined} - * @api - */ -olx.source.TileJSONOptions.prototype.transition; - - /** * @typedef {{attributions: (ol.AttributionLike|undefined), * cacheSize: (number|undefined), diff --git a/src/ol/source/TileJSON.js b/src/ol/source/TileJSON.js index 43e405ea7f..53be58de91 100644 --- a/src/ol/source/TileJSON.js +++ b/src/ol/source/TileJSON.js @@ -17,13 +17,40 @@ import SourceState from '../source/State.js'; import TileImage from '../source/TileImage.js'; import {createXYZ, extentFromProjection} from '../tilegrid.js'; +/** + * @typedef {Object} Options + * @property {ol.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 + * {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image} for more detail. + * @property {boolean} [jsonp=false] Use JSONP with callback to load the TileJSON. + * Useful when the server does not support CORS.. + * @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). + * Higher values can increase reprojection performance, but decrease precision. + * @property {tileJSON} [tileJSON] TileJSON configuration for this source. + * If not provided, `url` must be configured. + * @property {ol.TileLoadFunctionType} [tileLoadFunction] Optional function to load a tile given a URL. The default is + * ```js + * function(imageTile, src) { + * imageTile.getImage().src = src; + * }; + * ``` + * @property {string} [url] URL to the TileJSON file. If not provided, `tileJSON` must be configured. + * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. + * @property {number} [transition] Duration of the opacity transition for rendering. + * To disable the opacity transition, pass `transition: 0`. + */ + + /** * @classdesc * Layer source for tile data in TileJSON format. * * @constructor * @extends {ol.source.TileImage} - * @param {olx.source.TileJSONOptions} options TileJSON options. + * @param {module:ol/source/TileJSON~Options=} options TileJSON options. * @api */ const TileJSON = function(options) {