From 087b024a24cce919ee6ecb6b39842ef49a255b07 Mon Sep 17 00:00:00 2001 From: Frederic Junod Date: Wed, 21 Nov 2018 16:23:27 +0100 Subject: [PATCH] Change projection property in sources options to optional The `projection` property is not mandatory, the view's projection is used if not provided. --- src/ol/source/ImageWMS.js | 2 +- src/ol/source/Source.js | 2 +- src/ol/source/TileArcGISRest.js | 2 +- src/ol/source/TileImage.js | 2 +- src/ol/source/TileWMS.js | 2 +- src/ol/source/VectorTile.js | 2 +- src/ol/source/WMTS.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index 7e9699c106..6147df3294 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -40,7 +40,7 @@ const GETFEATUREINFO_IMAGE_SIZE = [101, 101]; * 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 {import("../proj.js").ProjectionLike} projection Projection. + * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view 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. diff --git a/src/ol/source/Source.js b/src/ol/source/Source.js index f65cbc8fba..295a56d5e7 100644 --- a/src/ol/source/Source.js +++ b/src/ol/source/Source.js @@ -31,7 +31,7 @@ import SourceState from './State.js'; * @typedef {Object} Options * @property {AttributionLike} [attributions] * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible. - * @property {import("../proj.js").ProjectionLike} projection + * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. * @property {SourceState} [state='ready'] * @property {boolean} [wrapX=false] */ diff --git a/src/ol/source/TileArcGISRest.js b/src/ol/source/TileArcGISRest.js index 5efebdecb8..ea0e8c85a3 100644 --- a/src/ol/source/TileArcGISRest.js +++ b/src/ol/source/TileArcGISRest.js @@ -29,7 +29,7 @@ import {appendParams} from '../uri.js'; * If this is not defined, a default grid will be used: if there is a projection * extent, the grid will be based on that; if not, a grid based on a global * extent with origin at 0,0 will be used. - * @property {import("../proj.js").ProjectionLike} projection Projection. + * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {import("../Tile.js").LoadFunction} [tileLoadFunction] Optional function to load a tile given a URL. diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index 1b329df065..8f9bfdcd66 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -23,7 +23,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js'; * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See 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 {import("../proj.js").ProjectionLike} projection Projection. + * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {import("./State.js").default} [state] Source state. diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 923ca2c900..684c5108cc 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -39,7 +39,7 @@ import {appendParams} from '../uri.js'; * this. See http://mapserver.org/output/tile_mode.html. * @property {boolean} [hidpi=true] Use the `ol/Map#pixelRatio` value when requesting * the image from the remote server. - * @property {import("../proj.js").ProjectionLike} projection Projection. + * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {typeof import("../ImageTile.js").default} [tileClass] Class used to instantiate image tiles. diff --git a/src/ol/source/VectorTile.js b/src/ol/source/VectorTile.js index 5f384c1931..63a266215a 100644 --- a/src/ol/source/VectorTile.js +++ b/src/ol/source/VectorTile.js @@ -20,7 +20,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid. * to `false` (e.g. for sources with polygons that represent administrative * boundaries or TopoJSON sources) allows the renderer to optimise fill and * stroke operations. - * @property {import("../proj.js").ProjectionLike} projection Projection. + * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. * @property {import("./State.js").default} [state] Source state. * @property {typeof import("../VectorTile.js").default} [tileClass] Class used to instantiate image tiles. * Default is {@link module:ol/VectorTile}. diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index 556649cada..b355a28db7 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -20,7 +20,7 @@ import {appendParams} from '../uri.js'; * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer. * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail. * @property {import("../tilegrid/WMTS.js").default} tileGrid Tile grid. - * @property {import("../proj.js").ProjectionLike} projection Projection. + * @property {import("../proj.js").ProjectionLike} [projection] Projection. Default is the view projection. * @property {number} [reprojectionErrorThreshold=0.5] Maximum allowed reprojection error (in pixels). * Higher values can increase reprojection performance, but decrease precision. * @property {import("./WMTSRequestEncoding.js").default|string} [requestEncoding='KVP'] Request encoding.