Remove olx.source.XYZOptions

This commit is contained in:
Florent gravin
2018-03-29 10:11:52 +02:00
parent 5de33d066b
commit 4b0f376f60
2 changed files with 40 additions and 176 deletions

View File

@@ -5,6 +5,45 @@ import {inherits} from '../index.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} [opaque=true] Whether the layer is opaque.
* @property {ol.ProjectionLike} [projection='EPSG:3857'] Projection.
* @property {boolean} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels).
* Higher values can increase reprojection performance, but decrease precision.
* @property {number} [maxZoom=18] Optional max zoom level.
* @property {number} [maxZoom=0] Optional min zoom level.
* @property {ol.tilegrid.WMTS} tileGrid Tile grid.
* @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 {number} [tilePixelRatio=1] The pixel ratio used by the tile service.
* For example, if the tile service advertizes 256px by 256px tiles but actually sends 512px
* by 512px images (for retina/hidpi devices) then `tilePixelRatio`
* should be set to `2`.
* @property {number|ol.Size} [tileSize=[256, 256]] The tile size used by the tile service.
* @property {ol.TileUrlFunctionType} [tileUrlFunction] Optional function to get
* tile URL given a tile coordinate and the projection.
* Required if url or urls are not provided.
* @property {string} [url] URL template. Must include `{x}`, `{y}` or `{-y}`,
* and `{z}` placeholders. A `{?-?}` template pattern, for example `subdomain{a-f}.domain.com`,
* may be used instead of defining each one separately in the `urls` option.
* @property {Array.<string>} [urls] An array of URL templates.
* @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 with URLs in a set XYZ format that are
@@ -24,7 +63,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
*
* @constructor
* @extends {ol.source.TileImage}
* @param {olx.source.XYZOptions=} opt_options XYZ options.
* @param {module:ol/source/XYZ~Options=} opt_options XYZ options.
* @api
*/
const XYZ = function(opt_options) {