Move olx.source.ImageWMSOptions to ol/source/ImageWMSOptions

This commit is contained in:
Florent gravin
2018-03-28 16:06:40 +02:00
parent c6acbb54fd
commit 125a54ff1e
2 changed files with 27 additions and 106 deletions

View File

@@ -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.<string,*>,
* projection: ol.ProjectionLike,
* ratio: (number|undefined),
* resolutions: (Array.<number>|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.<string,*>}
* @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.<number>|undefined}
* @api
*/
olx.source.ImageWMSOptions.prototype.resolutions;
/**
* WMS service URL.
* @type {string|undefined}
* @api
*/
olx.source.ImageWMSOptions.prototype.url;
/**
* @typedef {{
* cacheSize: (number|undefined),

View File

@@ -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.<string,*>} 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.<number>} [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) {