From f9452fb76b9b396d186307669447b584babc6c83 Mon Sep 17 00:00:00 2001 From: Florent gravin Date: Wed, 28 Mar 2018 16:34:34 +0200 Subject: [PATCH] Remove olx.source.StamenOptions --- externs/olx.js | 93 ----------------------------------------- src/ol/source/Stamen.js | 23 +++++++++- 2 files changed, 22 insertions(+), 94 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index d69a0c52c0..48a167b202 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -507,99 +507,6 @@ olx.source.TileDebugOptions.prototype.projection; olx.source.TileDebugOptions.prototype.tileGrid; -/** - * @typedef {{ - * cacheSize: (number|undefined), - * layer: string, - * minZoom: (number|undefined), - * maxZoom: (number|undefined), - * opaque: (boolean|undefined), - * reprojectionErrorThreshold: (number|undefined), - * tileLoadFunction: (ol.TileLoadFunctionType|undefined), - * url: (string|undefined), - * wrapX: (boolean|undefined) - * }} - */ -olx.source.StamenOptions; - - -/** - * Cache size. Default is `2048`. - * @type {number|undefined} - * @api - */ -olx.source.StamenOptions.prototype.cacheSize; - -/** - * Layer. - * @type {string} - * @api - */ -olx.source.StamenOptions.prototype.layer; - - -/** - * Minimum zoom. - * @type {number|undefined} - * @api - */ -olx.source.StamenOptions.prototype.minZoom; - - -/** - * Maximum zoom. - * @type {number|undefined} - * @api - */ -olx.source.StamenOptions.prototype.maxZoom; - - -/** - * Whether the layer is opaque. - * @type {boolean|undefined} - * @api - */ -olx.source.StamenOptions.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.StamenOptions.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.StamenOptions.prototype.tileLoadFunction; - - -/** - * URL template. Must include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders. - * @type {string|undefined} - * @api - */ -olx.source.StamenOptions.prototype.url; - - -/** - * Whether to wrap the world horizontally. Default is `true`. - * @type {boolean|undefined} - * @api - */ -olx.source.StamenOptions.prototype.wrapX; - - /** * @typedef {{attributions: (ol.AttributionLike|undefined), * cacheSize: (number|undefined), diff --git a/src/ol/source/Stamen.js b/src/ol/source/Stamen.js index a691162587..62a6fc6275 100644 --- a/src/ol/source/Stamen.js +++ b/src/ol/source/Stamen.js @@ -88,13 +88,34 @@ const ProviderConfig = { }; +/** + * @typedef {Object} Options + * @property {number} [cacheSize=2048] Cache size. + * @property {string} [layer] Layer. + * @property {number} [minZoom] Minimum zoom. + * @property {number} [maxZoom] Maximum zoom. + * @property {boolean} [opaque] Whether the layer is opaque. + * @property {boolean} [reprojectionErrorThreshold=0.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] 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 Stamen tile server. * * @constructor * @extends {ol.source.XYZ} - * @param {olx.source.StamenOptions} options Stamen options. + * @param {module:ol/source/Stamen~Options=} options Stamen options. * @api */ const Stamen = function(options) {