Use Array<Foo> instead of Array.<Foo>
This commit is contained in:
@@ -68,7 +68,7 @@ class Cluster extends VectorSource {
|
||||
this.distance = options.distance !== undefined ? options.distance : 20;
|
||||
|
||||
/**
|
||||
* @type {Array.<module:ol/Feature>}
|
||||
* @type {Array<module:ol/Feature>}
|
||||
* @protected
|
||||
*/
|
||||
this.features = [];
|
||||
@@ -189,7 +189,7 @@ class Cluster extends VectorSource {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<module:ol/Feature>} features Features
|
||||
* @param {Array<module:ol/Feature>} features Features
|
||||
* @return {module:ol/Feature} The cluster feature.
|
||||
* @protected
|
||||
*/
|
||||
|
||||
@@ -72,7 +72,7 @@ class ImageSourceEvent extends Event {
|
||||
* @property {module:ol/source/Source~AttributionLike} [attributions]
|
||||
* @property {module:ol/extent~Extent} [extent]
|
||||
* @property {module:ol/proj~ProjectionLike} projection
|
||||
* @property {Array.<number>} [resolutions]
|
||||
* @property {Array<number>} [resolutions]
|
||||
* @property {module:ol/source/State} [state]
|
||||
*/
|
||||
|
||||
@@ -98,7 +98,7 @@ class ImageSource extends Source {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.resolutions_ = options.resolutions !== undefined ?
|
||||
options.resolutions : null;
|
||||
@@ -119,7 +119,7 @@ class ImageSource extends Source {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Array.<number>} Resolutions.
|
||||
* @return {Array<number>} Resolutions.
|
||||
* @override
|
||||
*/
|
||||
getResolutions() {
|
||||
|
||||
@@ -32,7 +32,7 @@ import {appendParams} from '../uri.js';
|
||||
* @property {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport,
|
||||
* `2` means twice the size of the map viewport, and so on.
|
||||
* @property {Array.<number>} [resolutions] Resolutions. If specified, requests will be made for
|
||||
* @property {Array<number>} [resolutions] Resolutions. If specified, requests will be made for
|
||||
* these resolutions only.
|
||||
* @property {string} [url] ArcGIS Rest service URL for a Map Service or Image Service. The url
|
||||
* should include /MapServer or /ImageServer.
|
||||
|
||||
@@ -36,7 +36,7 @@ import ImageSource from '../source/Image.js';
|
||||
* @property {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @property {number} [ratio=1.5] Ratio. 1 means canvases 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.
|
||||
* @property {Array<number>} [resolutions] Resolutions.
|
||||
* If specified, new canvases will be created for these resolutions
|
||||
* @property {module:ol/source/State} [state] Source state.
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ import {appendParams} from '../uri.js';
|
||||
* @property {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @property {number} [ratio=1] 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.
|
||||
* @property {Array<number>} [resolutions] Resolutions.
|
||||
* If specified, requests will be made for these resolutions only.
|
||||
* @property {module:ol/Image~LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.
|
||||
* @property {Object} [params] Additional parameters.
|
||||
|
||||
@@ -45,7 +45,7 @@ const GETFEATUREINFO_IMAGE_SIZE = [101, 101];
|
||||
* @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.
|
||||
* @property {Array<number>} [resolutions] Resolutions.
|
||||
* If specified, requests will be made for these resolutions only.
|
||||
* @property {string} url WMS service URL.
|
||||
*/
|
||||
|
||||
@@ -37,8 +37,8 @@ import {create as createTransform} from '../transform.js';
|
||||
* data object is accessible from raster events, where it can be initialized in
|
||||
* "beforeoperations" and accessed again in "afteroperations".
|
||||
*
|
||||
* @typedef {function((Array.<Array.<number>>|Array.<ImageData>), Object):
|
||||
* (Array.<number>|ImageData)} Operation
|
||||
* @typedef {function((Array<Array<number>>|Array<ImageData>), Object):
|
||||
* (Array<number>|ImageData)} Operation
|
||||
*/
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class RasterSourceEvent extends Event {
|
||||
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {Array.<module:ol/source/Source|module:ol/layer/Layer>} sources Input
|
||||
* @property {Array<module:ol/source/Source|module:ol/layer/Layer>} sources Input
|
||||
* sources or layers. Vector layers must be configured with `renderMode: 'image'`.
|
||||
* @property {module:ol/source/Raster~Operation} [operation] Raster operation.
|
||||
* The operation will be called with data from input sources
|
||||
@@ -170,7 +170,7 @@ class RasterSource extends ImageSource {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<module:ol/renderer/canvas/Layer>}
|
||||
* @type {Array<module:ol/renderer/canvas/Layer>}
|
||||
*/
|
||||
this.renderers_ = createRenderers(options.sources);
|
||||
|
||||
@@ -455,8 +455,8 @@ function getImageData(renderer, frameState, layerState) {
|
||||
|
||||
/**
|
||||
* Get a list of layer states from a list of renderers.
|
||||
* @param {Array.<module:ol/renderer/canvas/Layer>} renderers Layer renderers.
|
||||
* @return {Array.<module:ol/layer/Layer~State>} The layer states.
|
||||
* @param {Array<module:ol/renderer/canvas/Layer>} renderers Layer renderers.
|
||||
* @return {Array<module:ol/layer/Layer~State>} The layer states.
|
||||
*/
|
||||
function getLayerStatesArray(renderers) {
|
||||
return renderers.map(function(renderer) {
|
||||
@@ -467,8 +467,8 @@ function getLayerStatesArray(renderers) {
|
||||
|
||||
/**
|
||||
* Create renderers for all sources.
|
||||
* @param {Array.<module:ol/source/Source>} sources The sources.
|
||||
* @return {Array.<module:ol/renderer/canvas/Layer>} Array of layer renderers.
|
||||
* @param {Array<module:ol/source/Source>} sources The sources.
|
||||
* @return {Array<module:ol/renderer/canvas/Layer>} Array of layer renderers.
|
||||
*/
|
||||
function createRenderers(sources) {
|
||||
const len = sources.length;
|
||||
|
||||
@@ -12,7 +12,7 @@ import SourceState from '../source/State.js';
|
||||
* A function that returns a string or an array of strings representing source
|
||||
* attributions.
|
||||
*
|
||||
* @typedef {function(module:ol/PluggableMap~FrameState): (string|Array.<string>)} Attribution
|
||||
* @typedef {function(module:ol/PluggableMap~FrameState): (string|Array<string>)} Attribution
|
||||
*/
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import SourceState from '../source/State.js';
|
||||
* * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`)
|
||||
* * a function that returns a string or array of strings (`{@link module:ol/source/Source~Attribution}`)
|
||||
*
|
||||
* @typedef {string|Array.<string>|module:ol/source/Source~Attribution} AttributionLike
|
||||
* @typedef {string|Array<string>|module:ol/source/Source~Attribution} AttributionLike
|
||||
*/
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ class Source extends BaseObject {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @return {Array.<number>|undefined} Resolutions.
|
||||
* @return {Array<number>|undefined} Resolutions.
|
||||
*/
|
||||
getResolutions() {}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import XYZ from '../source/XYZ.js';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
const ATTRIBUTIONS = [
|
||||
'Map tiles by <a href="https://stamen.com/">Stamen Design</a>, ' +
|
||||
|
||||
@@ -46,7 +46,7 @@ import {appendParams} from '../uri.js';
|
||||
* @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`.
|
||||
* @property {Array.<string>} urls ArcGIS Rest service urls. Use this instead of `url` when the ArcGIS
|
||||
* @property {Array<string>} urls ArcGIS Rest service urls. Use this instead of `url` when the ArcGIS
|
||||
* Service supports multiple urls for export requests.
|
||||
*/
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
|
||||
* @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 {Array<string>} [urls] An array of URL templates.
|
||||
* @property {boolean} [wrapX] Whether to wrap the world horizontally. The default, is to
|
||||
* request out-of-bounds tiles from the server. When set to `false`, only one
|
||||
* world will be rendered. When set to `true`, tiles will be requested for one
|
||||
|
||||
@@ -60,7 +60,7 @@ import {appendParams} from '../uri.js';
|
||||
* };
|
||||
* ```
|
||||
* @property {string} [url] WMS service URL.
|
||||
* @property {Array.<string>} [urls] WMS service urls.
|
||||
* @property {Array<string>} [urls] WMS service urls.
|
||||
* Use this instead of `url` when the WMS supports multiple urls for GetMap requests.
|
||||
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
|
||||
* When set to `false`, only one world
|
||||
|
||||
@@ -51,13 +51,13 @@ export class CustomTile extends Tile {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.grid_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.keys_ = null;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import {getKeyZXY} from '../tilecoord.js';
|
||||
* @property {number} [tilePixelRatio]
|
||||
* @property {module:ol/Tile~UrlFunction} [tileUrlFunction]
|
||||
* @property {string} [url]
|
||||
* @property {Array.<string>} [urls]
|
||||
* @property {Array<string>} [urls]
|
||||
* @property {boolean} [wrapX=true]
|
||||
* @property {number} [transition]
|
||||
*/
|
||||
@@ -67,7 +67,7 @@ class UrlTile extends TileSource {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {!Array.<string>|null}
|
||||
* @type {!Array<string>|null}
|
||||
*/
|
||||
this.urls = null;
|
||||
|
||||
@@ -110,7 +110,7 @@ class UrlTile extends TileSource {
|
||||
* Return the URLs used for this source.
|
||||
* When a tileUrlFunction is used instead of url or urls,
|
||||
* null will be returned.
|
||||
* @return {!Array.<string>|null} URLs.
|
||||
* @return {!Array<string>|null} URLs.
|
||||
* @api
|
||||
*/
|
||||
getUrls() {
|
||||
@@ -182,7 +182,7 @@ class UrlTile extends TileSource {
|
||||
|
||||
/**
|
||||
* Set the URLs to use for requests.
|
||||
* @param {Array.<string>} urls URLs.
|
||||
* @param {Array<string>} urls URLs.
|
||||
* @api
|
||||
*/
|
||||
setUrls(urls) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import RBush from '../structs/RBush.js';
|
||||
* returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this
|
||||
* is one of the standard {@link module:ol/loadingstrategy} strategies.
|
||||
*
|
||||
* @typedef {function(module:ol/extent~Extent, number): Array.<module:ol/extent~Extent>} LoadingStrategy
|
||||
* @typedef {function(module:ol/extent~Extent, number): Array<module:ol/extent~Extent>} LoadingStrategy
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -61,7 +61,7 @@ export class VectorSourceEvent extends Event {
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {module:ol/source/Source~AttributionLike} [attributions] Attributions.
|
||||
* @property {Array.<module:ol/Feature>|module:ol/Collection.<module:ol/Feature>} [features]
|
||||
* @property {Array<module:ol/Feature>|module:ol/Collection.<module:ol/Feature>} [features]
|
||||
* Features. If provided as {@link module:ol/Collection}, the features in the source
|
||||
* and the collection will stay in sync.
|
||||
* @property {module:ol/format/Feature} [format] The feature format used by the XHR
|
||||
@@ -247,7 +247,7 @@ class VectorSource extends Source {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string, Array.<module:ol/events~EventsKey>>}
|
||||
* @type {Object.<string, Array<module:ol/events~EventsKey>>}
|
||||
*/
|
||||
this.featureChangeKeys_ = {};
|
||||
|
||||
@@ -365,7 +365,7 @@ VectorSource.prototype.addToIndex_ = function(featureKey, feature) {
|
||||
|
||||
/**
|
||||
* Add a batch of features to the source.
|
||||
* @param {Array.<module:ol/Feature>} features Features to add.
|
||||
* @param {Array<module:ol/Feature>} features Features to add.
|
||||
* @api
|
||||
*/
|
||||
VectorSource.prototype.addFeatures = function(features) {
|
||||
@@ -376,7 +376,7 @@ VectorSource.prototype.addFeatures = function(features) {
|
||||
|
||||
/**
|
||||
* Add features without firing a `change` event.
|
||||
* @param {Array.<module:ol/Feature>} features Features.
|
||||
* @param {Array<module:ol/Feature>} features Features.
|
||||
* @protected
|
||||
*/
|
||||
VectorSource.prototype.addFeaturesInternal = function(features) {
|
||||
@@ -620,7 +620,7 @@ VectorSource.prototype.getFeaturesCollection = function() {
|
||||
|
||||
/**
|
||||
* Get all features on the source in random order.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
VectorSource.prototype.getFeatures = function() {
|
||||
@@ -634,7 +634,7 @@ VectorSource.prototype.getFeatures = function() {
|
||||
}
|
||||
}
|
||||
return (
|
||||
/** @type {Array.<module:ol/Feature>} */ (features)
|
||||
/** @type {Array<module:ol/Feature>} */ (features)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -642,7 +642,7 @@ VectorSource.prototype.getFeatures = function() {
|
||||
/**
|
||||
* Get all features whose geometry intersects the provided coordinate.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
VectorSource.prototype.getFeaturesAtCoordinate = function(coordinate) {
|
||||
@@ -662,7 +662,7 @@ VectorSource.prototype.getFeaturesAtCoordinate = function(coordinate) {
|
||||
* This method is not available when the source is configured with
|
||||
* `useSpatialIndex` set to `false`.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {Array.<module:ol/Feature>} Features.
|
||||
* @return {Array<module:ol/Feature>} Features.
|
||||
* @api
|
||||
*/
|
||||
VectorSource.prototype.getFeaturesInExtent = function(extent) {
|
||||
|
||||
@@ -50,7 +50,7 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
|
||||
* used instead of defining each one separately in the `urls` option.
|
||||
* @property {number} [transition] A duration for tile opacity
|
||||
* transitions in milliseconds. A duration of 0 disables the opacity transition.
|
||||
* @property {Array.<string>} [urls] An array of URL templates.
|
||||
* @property {Array<string>} [urls] An array of URL templates.
|
||||
* @property {boolean} [wrapX=true] Whether to wrap the world horizontally.
|
||||
* When set to `false`, only one world
|
||||
* will be rendered. When set to `true`, tiles will be wrapped horizontally to
|
||||
|
||||
@@ -48,7 +48,7 @@ import {appendParams} from '../uri.js';
|
||||
* imageTile.getImage().src = src;
|
||||
* };
|
||||
* ```
|
||||
* @property {Array.<string>} [urls] An array of URLs.
|
||||
* @property {Array<string>} [urls] An array of URLs.
|
||||
* Requests will be distributed among the URLs in this array.
|
||||
* @property {boolean} [wrapX=false] Whether to wrap the world horizontally.
|
||||
* @property {number} [transition] Duration of the opacity transition for rendering.
|
||||
@@ -328,7 +328,7 @@ export function optionsFromCapabilities(wmtsCap, config) {
|
||||
}
|
||||
const matrixSet = /** @type {string} */
|
||||
(l['TileMatrixSetLink'][idx]['TileMatrixSet']);
|
||||
const matrixLimits = /** @type {Array.<Object>} */
|
||||
const matrixLimits = /** @type {Array<Object>} */
|
||||
(l['TileMatrixSetLink'][idx]['TileMatrixSetLimits']);
|
||||
|
||||
let format = /** @type {string} */ (l['Format'][0]);
|
||||
@@ -399,7 +399,7 @@ export function optionsFromCapabilities(wmtsCap, config) {
|
||||
|
||||
const tileGrid = createFromCapabilitiesMatrixSet(matrixSetObj, extent, matrixLimits);
|
||||
|
||||
/** @type {!Array.<string>} */
|
||||
/** @type {!Array<string>} */
|
||||
const urls = [];
|
||||
let requestEncoding = config['requestEncoding'];
|
||||
requestEncoding = requestEncoding !== undefined ? requestEncoding : '';
|
||||
|
||||
@@ -37,7 +37,7 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
||||
* @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 {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`.
|
||||
|
||||
Reference in New Issue
Block a user