diff --git a/externs/olx.js b/externs/olx.js index b2f385e474..aa86865178 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -665,111 +665,6 @@ olx.source.RasterOptions.prototype.threads; olx.source.RasterOptions.prototype.operationType; -/** - * @typedef {{attributions: (ol.AttributionLike|undefined), - * crossOrigin: (null|string|undefined), - * hidpi: (boolean|undefined), - * serverType: (ol.source.WMSServerType|string|undefined), - * imageLoadFunction: (ol.ImageLoadFunctionType|undefined), - * params: Object., - * projection: ol.ProjectionLike, - * ratio: (number|undefined), - * resolutions: (Array.|undefined), - * url: (string|undefined)}} - */ -olx.source.ImageWMSOptions; - - -/** - * Attributions. - * @type {ol.AttributionLike|undefined} - * @api - */ -olx.source.ImageWMSOptions.prototype.attributions; - - -/** - * 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.ImageWMSOptions.prototype.crossOrigin; - - -/** - * Use the `ol.Map#pixelRatio` value when requesting the image from the remote - * server. Default is `true`. - * @type {boolean|undefined} - * @api - */ -olx.source.ImageWMSOptions.prototype.hidpi; - - -/** - * The type of the remote WMS server: `mapserver`, `geoserver` or `qgis`. Only - * needed if `hidpi` is `true`. Default is `undefined`. - * @type {ol.source.WMSServerType|string|undefined} - * @api - */ -olx.source.ImageWMSOptions.prototype.serverType; - - -/** - * Optional function to load an image given a URL. - * @type {ol.ImageLoadFunctionType|undefined} - * @api - */ -olx.source.ImageWMSOptions.prototype.imageLoadFunction; - - -/** - * WMS request parameters. At least a `LAYERS` param is required. `STYLES` is - * `''` by default. `VERSION` is `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX` - * and `CRS` (`SRS` for WMS version < 1.3.0) will be set dynamically. - * @type {Object.} - * @api - */ -olx.source.ImageWMSOptions.prototype.params; - - -/** - * Projection. - * @type {ol.ProjectionLike} - * @api - */ -olx.source.ImageWMSOptions.prototype.projection; - - -/** - * Ratio. `1` means image requests are the size of the map viewport, `2` means - * twice the width and height of the map viewport, and so on. Must be `1` or - * higher. Default is `1.5`. - * @type {number|undefined} - * @api - */ -olx.source.ImageWMSOptions.prototype.ratio; - - -/** - * Resolutions. If specified, requests will be made for these resolutions only. - * @type {Array.|undefined} - * @api - */ -olx.source.ImageWMSOptions.prototype.resolutions; - - -/** - * WMS service URL. - * @type {string|undefined} - * @api - */ -olx.source.ImageWMSOptions.prototype.url; - - /** * @typedef {{ * cacheSize: (number|undefined), diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index 431ef1f71e..6cab6bd7a5 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -17,6 +17,32 @@ import WMSServerType from '../source/WMSServerType.js'; import {compareVersions} from '../string.js'; import {appendParams} from '../uri.js'; +/** + * @typedef {Object} Options + * @property {ol.AttributionLike} [attributions] Attributions. + * @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} [hidpi=true] Use the `ol.Map#pixelRatio` value when requesting + * the image from the remote server. + * @property {ol.source.WMSServerType|string} [serverType=undefined] The type of + * the remote WMS server: `mapserver`, `geoserver` or `qgis`. Only needed if `hidpi` is `true`. + * @property {ol.ImageLoadFunctionType} [imageLoadFunction] Optional function to load an image given a URL. + * @property {Object.} params WMS request parameters. + * At least a `LAYERS` param is required. `STYLES` is + * `''` by default. `VERSION` is `1.3.0` by default. `WIDTH`, `HEIGHT`, `BBOX` + * and `CRS` (`SRS` for WMS version < 1.3.0) will be set dynamically. + * @property {ol.ProjectionLike} projection Projection. + * @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport, `2` means + * twice the width and height of the map viewport, and so on. Must be `1` or + * higher. + * @property {Array.} [resolutions] Resolutions. + * If specified, requests will be made for these resolutions only. + * @property {string} url WMS service URL. + */ + + /** * @classdesc * Source for WMS servers providing single, untiled images. @@ -24,7 +50,7 @@ import {appendParams} from '../uri.js'; * @constructor * @fires ol.source.Image.Event * @extends {ol.source.Image} - * @param {olx.source.ImageWMSOptions=} opt_options Options. + * @param {module:ol/source/ImageWMS~Options=} [opt_options] ImageWMS options. * @api */ const ImageWMS = function(opt_options) {