diff --git a/externs/olx.js b/externs/olx.js index aa86865178..610019c424 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -515,97 +515,6 @@ olx.source.TileDebugOptions.prototype.tileGrid; olx.source.TileDebugOptions.prototype.wrapX; -/** - * @typedef {{attributions: (ol.AttributionLike|undefined), - * cacheSize: (number|undefined), - * crossOrigin: (null|string|undefined), - * maxZoom: (number|undefined), - * opaque: (boolean|undefined), - * reprojectionErrorThreshold: (number|undefined), - * tileLoadFunction: (ol.TileLoadFunctionType|undefined), - * url: (string|undefined), - * wrapX: (boolean|undefined)}} - */ -olx.source.OSMOptions; - - -/** - * Attributions. - * @type {ol.AttributionLike|undefined} - * @api - */ -olx.source.OSMOptions.prototype.attributions; - - -/** - * Cache size. Default is `2048`. - * @type {number|undefined} - * @api - */ -olx.source.OSMOptions.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. - * - * Default is `anonymous`. - * @type {null|string|undefined} - * @api - */ -olx.source.OSMOptions.prototype.crossOrigin; - - -/** - * Max zoom. Default is `19`. - * @type {number|undefined} - * @api - */ -olx.source.OSMOptions.prototype.maxZoom; - - -/** - * Whether the layer is opaque. Default is `true`. - * @type {boolean|undefined} - * @api - */ -olx.source.OSMOptions.prototype.opaque; - - -/** - * 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.OSMOptions.prototype.reprojectionErrorThreshold; - - -/** - * 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.OSMOptions.prototype.tileLoadFunction; - - -/** - * URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders. - * Default is `https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png`. - * @type {string|undefined} - * @api - */ -olx.source.OSMOptions.prototype.url; - - /** * @typedef {{sources: Array., * operation: (ol.RasterOperation|undefined), diff --git a/src/ol/source/OSM.js b/src/ol/source/OSM.js index a583bc5ffc..1aae16eb9e 100644 --- a/src/ol/source/OSM.js +++ b/src/ol/source/OSM.js @@ -17,13 +17,37 @@ export const ATTRIBUTION = '© ' + 'contributors.'; +/** + * @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 {number} [maxZoom=19] Max zoom. + * @property {boolean} [opaque=true] Whether the layer is opaque. + * @property {number} [reprojectionErrorThreshold=1.5] Maximum allowed reprojection error (in pixels). + * Higher values can increase reprojection performance, but decrease precision. + * @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='https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png'] URL template. + * Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders. + * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. + */ + + /** * @classdesc * Layer source for the OpenStreetMap tile server. * * @constructor * @extends {ol.source.XYZ} - * @param {olx.source.OSMOptions=} opt_options Open Street Map options. + * @param {module:ol/source/OSM~Options=} [opt_options] Open Street Map options. * @api */ const OSM = function(opt_options) {