Move ol.AttributionLike to ol/source/Source

This commit is contained in:
Michael Kuenzli
2018-04-19 09:35:30 +02:00
committed by Frederic Junod
parent 833a4591df
commit 71bb2ce019
20 changed files with 33 additions and 34 deletions

View File

@@ -8,7 +8,7 @@ import XYZ from '../source/XYZ.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to

View File

@@ -14,7 +14,7 @@ import VectorSource from '../source/Vector.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [distance=20] Minimum distance in pixels between clusters. * @property {number} [distance=20] Minimum distance in pixels between clusters.
* @property {module:ol/extent~Extent} [extent] Extent. * @property {module:ol/extent~Extent} [extent] Extent.
* @property {ol.format.Feature} [format] Format. * @property {ol.format.Feature} [format] Format.

View File

@@ -69,7 +69,7 @@ inherits(ImageSourceEvent, Event);
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] * @property {module:ol/source/Source~AttributionLike} [attributions]
* @property {module:ol/extent~Extent} [extent] * @property {module:ol/extent~Extent} [extent]
* @property {module:ol/proj~ProjectionLike} projection * @property {module:ol/proj~ProjectionLike} projection
* @property {Array.<number>} [resolutions] * @property {Array.<number>} [resolutions]

View File

@@ -14,7 +14,7 @@ import {appendParams} from '../uri.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * 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 * access pixel data with the Canvas renderer. See

View File

@@ -8,7 +8,7 @@ import ImageSource from '../source/Image.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {ol.CanvasFunctionType} [canvasFunction] Canvas function. * @property {ol.CanvasFunctionType} [canvasFunction] Canvas function.
* The function returning the canvas element used by the source * The function returning the canvas element used by the source
* as an image. The arguments passed to the function are: `{module:ol/extent~Extent}` the * as an image. The arguments passed to the function are: `{module:ol/extent~Extent}` the

View File

@@ -13,7 +13,7 @@ import ImageSource, {defaultImageLoadFunction} from '../source/Image.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * 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 * access pixel data with the Canvas renderer. See

View File

@@ -19,7 +19,7 @@ import {appendParams} from '../uri.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * 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 * access pixel data with the Canvas renderer. See

View File

@@ -19,7 +19,7 @@ export const ATTRIBUTION = '&copy; ' +
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to

View File

@@ -8,9 +8,21 @@ import {get as getProjection} from '../proj.js';
import SourceState from '../source/State.js'; import SourceState from '../source/State.js';
/**
* A type that can be used to provide attribution information for data sources.
*
* It represents either
* * a simple string (e.g. `'© Acme Inc.'`)
* * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`)
* * a function that returns a string or array of strings (`{@link ol.Attribution}`)
*
* @typedef {string|Array.<string>|ol.Attribution} AttributionLike
*/
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] * @property {module:ol/source/Source~AttributionLike} [attributions]
* @property {module:ol/proj~ProjectionLike} projection * @property {module:ol/proj~ProjectionLike} projection
* @property {module:ol/source/State~State} [state] * @property {module:ol/source/State~State} [state]
* @property {boolean} [wrapX] * @property {boolean} [wrapX]
@@ -66,7 +78,7 @@ inherits(Source, BaseObject);
/** /**
* Turns the attributions option into an attributions function. * Turns the attributions option into an attributions function.
* @param {ol.AttributionLike|undefined} attributionLike The attribution option. * @param {module:ol/source/Source~AttributionLike|undefined} attributionLike The attribution option.
* @return {?ol.Attribution} An attribution function (or null). * @return {?ol.Attribution} An attribution function (or null).
*/ */
Source.prototype.adaptAttributions_ = function(attributionLike) { Source.prototype.adaptAttributions_ = function(attributionLike) {
@@ -157,7 +169,7 @@ Source.prototype.refresh = function() {
/** /**
* Set the attributions of the source. * Set the attributions of the source.
* @param {ol.AttributionLike|undefined} attributions Attributions. * @param {module:ol/source/Source~AttributionLike|undefined} attributions Attributions.
* Can be passed as `string`, `Array<string>`, `{@link ol.Attribution}`, * Can be passed as `string`, `Array<string>`, `{@link ol.Attribution}`,
* or `undefined`. * or `undefined`.
* @api * @api

View File

@@ -14,7 +14,7 @@ import {wrapX, getForProjection as getTileGridForProjection} from '../tilegrid.j
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] * @property {module:ol/source/Source~AttributionLike} [attributions]
* @property {number} [cacheSize] * @property {number} [cacheSize]
* @property {module:ol/extent~Extent} [extent] * @property {module:ol/extent~Extent} [extent]
* @property {boolean} [opaque] * @property {boolean} [opaque]

View File

@@ -16,7 +16,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to

View File

@@ -19,7 +19,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to

View File

@@ -19,7 +19,7 @@ import {appendParams} from '../uri.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to

View File

@@ -10,7 +10,7 @@ import {getKeyZXY} from '../tilecoord.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] * @property {module:ol/source/Source~AttributionLike} [attributions]
* @property {number} [cacheSize] * @property {number} [cacheSize]
* @property {module:ol/extent~Extent} [extent] * @property {module:ol/extent~Extent} [extent]
* @property {boolean} [opaque] * @property {boolean} [opaque]

View File

@@ -50,7 +50,7 @@ inherits(VectorSourceEvent, Event);
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {Array.<module:ol/Feature~Feature>|ol.Collection.<module:ol/Feature~Feature>} [features] * @property {Array.<module:ol/Feature~Feature>|ol.Collection.<module:ol/Feature~Feature>} [features]
* Features. If provided as {@link ol.Collection}, the features in the source * Features. If provided as {@link ol.Collection}, the features in the source
* and the collection will stay in sync. * and the collection will stay in sync.

View File

@@ -12,7 +12,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=128] Cache size. * @property {number} [cacheSize=128] Cache size.
* @property {module:ol/format/Feature~FeatureFormat} [format] Feature format for tiles. Used and required by the default. * @property {module:ol/format/Feature~FeatureFormat} [format] Feature format for tiles. Used and required by the default.
* @property {boolean} [overlaps=true] This source may have overlapping geometries. Setting this * @property {boolean} [overlaps=true] This source may have overlapping geometries. Setting this

View File

@@ -14,7 +14,7 @@ import {appendParams} from '../uri.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to

View File

@@ -7,7 +7,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to

View File

@@ -81,7 +81,7 @@ CustomTile.prototype.getImage = function() {
/** /**
* @typedef {Object} Options * @typedef {Object} Options
* @property {ol.AttributionLike} [attributions] Attributions. * @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
* @property {number} [cacheSize=2048] Cache size. * @property {number} [cacheSize=2048] Cache size.
* @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that * @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 * you must provide a `crossOrigin` value if you are using the WebGL renderer or if you want to

View File

@@ -21,19 +21,6 @@ const ol = {};
*/ */
/**
* A type that can be used to provide attribution information for data sources.
*
* It represents either
* * a simple string (e.g. `'© Acme Inc.'`)
* * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`)
* * a function that returns a string or array of strings (`{@link ol.Attribution}`)
*
* @typedef {string|Array.<string>|ol.Attribution}
*/
ol.AttributionLike;
/** /**
* A function that returns a string or an array of strings representing source * A function that returns a string or an array of strings representing source
* attributions. * attributions.