Set api annotation on classdesc, not constructor

This commit is contained in:
ahocevar
2018-07-21 17:25:22 +02:00
parent 2767ddfdc7
commit bbe0a66d07
101 changed files with 484 additions and 382 deletions
+6 -4
View File
@@ -44,13 +44,15 @@ const TOS_ATTRIBUTION = '<a class="ol-attribution-bing-tos" ' +
* To disable the opacity transition, pass `transition: 0`.
*/
/**
* @classdesc
* Layer source for Bing Maps tile data.
* @api
*/
class BingMaps extends TileImage {
/**
* @classdesc
* Layer source for Bing Maps tile data.
*
* @param {module:ol/source/BingMaps~Options=} options Bing Maps options.
* @api
*/
constructor(options) {
+5 -4
View File
@@ -31,13 +31,14 @@ import XYZ from '../source/XYZ.js';
*/
/**
* @classdesc
* Layer source for the CartoDB Maps API.
* @api
*/
class CartoDB extends XYZ {
/**
* @classdesc
* Layer source for the CartoDB Maps API.
*
* @param {module:ol/source/CartoDB~Options=} options CartoDB options.
* @api
*/
constructor(options) {
super({
+7 -6
View File
@@ -36,15 +36,16 @@ import VectorSource from '../source/Vector.js';
*/
/**
* @classdesc
* Layer source to cluster vector data. Works out of the box with point
* geometries. For other geometry types, or if not all geometries should be
* considered for clustering, a custom `geometryFunction` can be defined.
* @api
*/
class Cluster extends VectorSource {
/**
* @classdesc
* Layer source to cluster vector data. Works out of the box with point
* geometries. For other geometry types, or if not all geometries should be
* considered for clustering, a custom `geometryFunction` can be defined.
*
* @param {module:ol/source/Cluster~Options=} options Cluster options.
* @api
*/
constructor(options) {
super({
+12 -11
View File
@@ -41,13 +41,13 @@ const ImageSourceEventType = {
};
/**
* @classdesc
* Events emitted by {@link module:ol/source/Image~ImageSource} instances are instances of this
* type.
*/
class ImageSourceEvent extends Event {
/**
* @classdesc
* Events emitted by {@link module:ol/source/Image~ImageSource} instances are instances of this
* type.
*
* @param {string} type Type.
* @param {module:ol/Image} image The image.
*/
@@ -77,15 +77,16 @@ class ImageSourceEvent extends Event {
*/
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for sources providing a single image.
* @api
*/
class ImageSource extends Source {
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for sources providing a single image.
*
* @param {module:ol/source/Image~Options} options Single image source options.
* @api
*/
constructor(options) {
super({
+12 -10
View File
@@ -39,19 +39,21 @@ import {appendParams} from '../uri.js';
*/
/**
* @classdesc
* Source for data from ArcGIS Rest services providing single, untiled images.
* Useful when underlying map service has labels.
*
* If underlying map service is not using labels,
* take advantage of ol image caching and use
* {@link module:ol/source/TileArcGISRest} data source.
*
* @fires ol/source/Image~ImageSourceEvent
* @api
*/
class ImageArcGISRest extends ImageSource {
/**
* @classdesc
* Source for data from ArcGIS Rest services providing single, untiled images.
* Useful when underlying map service has labels.
*
* If underlying map service is not using labels,
* take advantage of ol image caching and use
* {@link module:ol/source/TileArcGISRest} data source.
*
* @fires ol/source/Image~ImageSourceEvent
* @param {module:ol/source/ImageArcGISRest~Options=} opt_options Image ArcGIS Rest Options.
* @api
*/
constructor(opt_options) {
+5 -4
View File
@@ -42,13 +42,14 @@ import ImageSource from '../source/Image.js';
*/
/**
* @classdesc
* Base class for image sources where a canvas element is the image.
* @api
*/
class ImageCanvasSource extends ImageSource {
/**
* @classdesc
* Base class for image sources where a canvas element is the image.
*
* @param {module:ol/source/ImageCanvas~Options=} options ImageCanvas options.
* @api
*/
constructor(options) {
+7 -5
View File
@@ -32,14 +32,16 @@ import {appendParams} from '../uri.js';
*/
/**
* @classdesc
* Source for images from Mapguide servers
*
* @fires ol/source/Image~ImageSourceEvent
* @api
*/
class ImageMapGuide extends ImageSource {
/**
* @classdesc
* Source for images from Mapguide servers
*
* @fires ol/source/Image~ImageSourceEvent
* @param {module:ol/source/ImageMapGuide~Options=} options ImageMapGuide options.
* @api
*/
constructor(options) {
+5 -4
View File
@@ -28,13 +28,14 @@ import ImageSource, {defaultImageLoadFunction} from '../source/Image.js';
*/
/**
* @classdesc
* A layer source for displaying a single, static image.
* @api
*/
class Static extends ImageSource {
/**
* @classdesc
* A layer source for displaying a single, static image.
*
* @param {module:ol/source/ImageStatic~Options=} options ImageStatic options.
* @api
*/
constructor(options) {
const imageExtent = options.imageExtent;
+7 -5
View File
@@ -51,14 +51,16 @@ const GETFEATUREINFO_IMAGE_SIZE = [101, 101];
*/
/**
* @classdesc
* Source for WMS servers providing single, untiled images.
*
* @fires ol/source/Image~ImageSourceEvent
* @api
*/
class ImageWMS extends ImageSource {
/**
* @classdesc
* Source for WMS servers providing single, untiled images.
*
* @fires ol/source/Image~ImageSourceEvent
* @param {module:ol/source/ImageWMS~Options=} [opt_options] ImageWMS options.
* @api
*/
constructor(opt_options) {
+5 -5
View File
@@ -41,14 +41,14 @@ export const ATTRIBUTION = '&copy; ' +
*/
/**
* @classdesc
* Layer source for the OpenStreetMap tile server.
* @api
*/
class OSM extends XYZ {
/**
* @classdesc
* Layer source for the OpenStreetMap tile server.
*
* @param {module:ol/source/OSM~Options=} [opt_options] Open Street Map options.
* @api
*/
constructor(opt_options) {
+14 -12
View File
@@ -72,13 +72,13 @@ const RasterOperationType = {
};
/**
* @classdesc
* Events emitted by {@link module:ol/source/Raster} instances are instances of this
* type.
*/
class RasterSourceEvent extends Event {
/**
* @classdesc
* Events emitted by {@link module:ol/source/Raster} instances are instances of this
* type.
*
* @param {string} type Type.
* @param {module:ol/PluggableMap~FrameState} frameState The frame state.
* @param {Object} data An object made available to operations.
@@ -133,16 +133,18 @@ class RasterSourceEvent extends Event {
*/
/**
* @classdesc
* A source that transforms data from any number of input sources using an
* {@link module:ol/source/Raster~Operation} function to transform input pixel values into
* output pixel values.
*
* @fires ol/source/Raster~RasterSourceEvent
* @api
*/
class RasterSource extends ImageSource {
/**
* @classdesc
* A source that transforms data from any number of input sources using an
* {@link module:ol/source/Raster~Operation} function to transform input pixel values into
* output pixel values.
*
* @fires ol/source/Raster~RasterSourceEvent
* @param {module:ol/source/Raster~Options=} options Options.
* @api
*/
constructor(options) {
super({});
+9 -8
View File
@@ -37,17 +37,18 @@ import SourceState from '../source/State.js';
*/
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for {@link module:ol/layer/Layer~Layer} sources.
*
* A generic `change` event is triggered when the state of the source changes.
* @api
*/
class Source extends BaseObject {
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for {@link module:ol/layer/Layer~Layer} sources.
*
* A generic `change` event is triggered when the state of the source changes.
*
* @param {module:ol/source/Source~Options} options Source options.
* @api
*/
constructor(options) {
+5 -5
View File
@@ -109,14 +109,14 @@ const ProviderConfig = {
*/
/**
* @classdesc
* Layer source for the Stamen tile server.
* @api
*/
class Stamen extends XYZ {
/**
* @classdesc
* Layer source for the Stamen tile server.
*
* @param {module:ol/source/Stamen~Options=} options Stamen options.
* @api
*/
constructor(options) {
const i = options.layer.indexOf('-');
+11 -10
View File
@@ -27,15 +27,16 @@ import {wrapX, getForProjection as getTileGridForProjection} from '../tilegrid.j
*/
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for sources providing images divided into a tile grid.
* @api
*/
class TileSource extends Source {
/**
* @classdesc
* Abstract base class; normally only used for creating subclasses and not
* instantiated in apps.
* Base class for sources providing images divided into a tile grid.
*
* @param {module:ol/source/Tile~Options=} options SourceTile source options.
* @api
*/
constructor(options) {
@@ -307,12 +308,12 @@ TileSource.prototype.useTile = UNDEFINED;
* @classdesc
* Events emitted by {@link module:ol/source/Tile~TileSource} instances are instances of this
* type.
*
* @param {string} type Type.
* @param {module:ol/Tile} tile The tile.
*/
export class TileSourceEvent extends Event {
/**
* @param {string} type Type.
* @param {module:ol/Tile} tile The tile.
*/
constructor(type, tile) {
super(type);
+9 -8
View File
@@ -51,17 +51,18 @@ import {appendParams} from '../uri.js';
*/
/**
* @classdesc
* Layer source for tile data from ArcGIS Rest services. Map and Image
* Services are supported.
*
* For cached ArcGIS services, better performance is available using the
* {@link module:ol/source/XYZ~XYZ} data source.
* @api
*/
class TileArcGISRest extends TileImage {
/**
* @classdesc
* Layer source for tile data from ArcGIS Rest services. Map and Image
* Services are supported.
*
* For cached ArcGIS services, better performance is available using the
* {@link module:ol/source/XYZ~XYZ} data source.
*
* @param {module:ol/source/TileArcGISRest~Options=} opt_options Tile ArcGIS Rest options.
* @api
*/
constructor(opt_options) {
+9 -8
View File
@@ -80,17 +80,18 @@ class LabeledTile extends Tile {
*/
/**
* @classdesc
* A pseudo tile source, which does not fetch tiles from a server, but renders
* a grid outline for the tile grid/projection along with the coordinates for
* each tile. See examples/canvas-tiles for an example.
*
* Uses Canvas context2d, so requires Canvas support.
* @api
*/
class TileDebug extends TileSource {
/**
* @classdesc
* A pseudo tile source, which does not fetch tiles from a server, but renders
* a grid outline for the tile grid/projection along with the coordinates for
* each tile. See examples/canvas-tiles for an example.
*
* Uses Canvas context2d, so requires Canvas support.
*
* @param {module:ol/source/TileDebug~Options=} options Debug tile options.
* @api
*/
constructor(options) {
+7 -5
View File
@@ -54,14 +54,16 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
*/
/**
* @classdesc
* Base class for sources providing images divided into a tile grid.
*
* @fires module:ol/source/Tile~TileSourceEvent
* @api
*/
class TileImage extends UrlTile {
/**
* @classdesc
* Base class for sources providing images divided into a tile grid.
*
* @fires module:ol/source/Tile~TileSourceEvent
* @param {module:ol/source/TileImage~Options=} options Image tile options.
* @api
*/
constructor(options) {
+5 -4
View File
@@ -44,13 +44,14 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
*/
/**
* @classdesc
* Layer source for tile data in TileJSON format.
* @api
*/
class TileJSON extends TileImage {
/**
* @classdesc
* Layer source for tile data in TileJSON format.
*
* @param {module:ol/source/TileJSON~Options=} options TileJSON options.
* @api
*/
constructor(options) {
super({
+5 -4
View File
@@ -71,13 +71,14 @@ import {appendParams} from '../uri.js';
*/
/**
* @classdesc
* Layer source for tile data from WMS servers.
* @api
*/
class TileWMS extends TileImage {
/**
* @classdesc
* Layer source for tile data from WMS servers.
*
* @param {module:ol/source/TileWMS~Options=} [opt_options] Tile WMS options.
* @api
*/
constructor(opt_options) {
+13 -13
View File
@@ -17,16 +17,16 @@ import {getKeyZXY} from '../tilecoord.js';
import {createXYZ, extentFromProjection} from '../tilegrid.js';
/**
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState} state State.
* @param {string} src Image source URI.
* @param {module:ol/extent~Extent} extent Extent of the tile.
* @param {boolean} preemptive Load the tile when visible (before it's needed).
* @param {boolean} jsonp Load the tile as a script.
*/
export class CustomTile extends Tile {
/**
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState} state State.
* @param {string} src Image source URI.
* @param {module:ol/extent~Extent} extent Extent of the tile.
* @param {boolean} preemptive Load the tile when visible (before it's needed).
* @param {boolean} jsonp Load the tile as a script.
*/
constructor(tileCoord, state, src, extent, preemptive, jsonp) {
super(tileCoord, state);
@@ -267,14 +267,14 @@ CustomTile.prototype.load = function() {
*/
/**
* @classdesc
* Layer source for UTFGrid interaction data loaded from TileJSON format.
* @api
*/
class UTFGrid extends TileSource {
/**
* @classdesc
* Layer source for UTFGrid interaction data loaded from TileJSON format.
*
* @param {module:ol/source/UTFGrid~Options=} options Source options.
* @api
*/
constructor(options) {
super({
+6 -4
View File
@@ -27,12 +27,14 @@ import {getKeyZXY} from '../tilecoord.js';
*/
/**
* @classdesc
* Base class for sources providing tiles divided into a tile grid over http.
*
* @fires module:ol/source/TileEvent
*/
class UrlTile extends TileSource {
/**
* @classdesc
* Base class for sources providing tiles divided into a tile grid over http.
*
* @fires module:ol/source/TileEvent
* @param {module:ol/source/UrlTile~Options=} options Image tile options.
*/
constructor(options) {
+13 -11
View File
@@ -35,12 +35,13 @@ import RBush from '../structs/RBush.js';
* @classdesc
* Events emitted by {@link module:ol/source/Vector} instances are instances of this
* type.
*
* @param {string} type Type.
* @param {module:ol/Feature=} opt_feature Feature.
*/
export class VectorSourceEvent extends Event {
/**
* @param {string} type Type.
* @param {module:ol/Feature=} opt_feature Feature.
*/
constructor(type, opt_feature) {
super(type);
@@ -147,17 +148,18 @@ export class VectorSourceEvent extends Event {
*/
/**
* @classdesc
* Provides a source of features for vector layers. Vector features provided
* by this source are suitable for editing. See {@link module:ol/source/VectorTile~VectorTile} for
* vector data that is optimized for rendering.
*
* @fires ol/source/Vector~VectorSourceEvent
* @api
*/
class VectorSource extends Source {
/**
* @classdesc
* Provides a source of features for vector layers. Vector features provided
* by this source are suitable for editing. See {@link module:ol/source/VectorTile~VectorTile} for
* vector data that is optimized for rendering.
*
* @fires ol/source/Vector~VectorSourceEvent
* @param {module:ol/source/Vector~Options=} opt_options Vector source options.
* @api
*/
constructor(opt_options) {
+13 -12
View File
@@ -58,21 +58,22 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
*/
/**
* @classdesc
* Class for layer sources providing vector data divided into a tile grid, to be
* used with {@link module:ol/layer/VectorTile~VectorTile}. Although this source receives tiles
* with vector features from the server, it is not meant for feature editing.
* Features are optimized for rendering, their geometries are clipped at or near
* tile boundaries and simplified for a view resolution. See
* {@link module:ol/source/Vector} for vector sources that are suitable for feature
* editing.
*
* @fires module:ol/source/Tile~TileSourceEvent
* @api
*/
class VectorTile extends UrlTile {
/**
* @classdesc
* Class for layer sources providing vector data divided into a tile grid, to be
* used with {@link module:ol/layer/VectorTile~VectorTile}. Although this source receives tiles
* with vector features from the server, it is not meant for feature editing.
* Features are optimized for rendering, their geometries are clipped at or near
* tile boundaries and simplified for a view resolution. See
* {@link module:ol/source/Vector} for vector sources that are suitable for feature
* editing.
*
* @fires module:ol/source/Tile~TileSourceEvent
* @param {module:ol/source/VectorTile~Options=} options Vector tile options.
* @api
*/
constructor(options) {
const projection = options.projection || 'EPSG:3857';
+5 -5
View File
@@ -56,14 +56,14 @@ import {appendParams} from '../uri.js';
*/
/**
* @classdesc
* Layer source for tile data from WMTS servers.
* @api
*/
class WMTS extends TileImage {
/**
* @classdesc
* Layer source for tile data from WMTS servers.
*
* @param {module:ol/source/WMTS~Options=} options WMTS options.
* @api
*/
constructor(options) {
+18 -18
View File
@@ -44,27 +44,27 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js';
*/
/**
* @classdesc
* Layer source for tile data with URLs in a set XYZ format that are
* defined in a URL template. By default, this follows the widely-used
* Google grid where `x` 0 and `y` 0 are in the top left. Grids like
* TMS where `x` 0 and `y` 0 are in the bottom left can be used by
* using the `{-y}` placeholder in the URL template, so long as the
* source does not have a custom tile grid. In this case,
* {@link module:ol/source/TileImage} can be used with a `tileUrlFunction`
* such as:
*
* tileUrlFunction: function(coordinate) {
* return 'http://mapserver.com/' + coordinate[0] + '/' +
* coordinate[1] + '/' + coordinate[2] + '.png';
* }
*
* @api
*/
class XYZ extends TileImage {
/**
* @classdesc
* Layer source for tile data with URLs in a set XYZ format that are
* defined in a URL template. By default, this follows the widely-used
* Google grid where `x` 0 and `y` 0 are in the top left. Grids like
* TMS where `x` 0 and `y` 0 are in the bottom left can be used by
* using the `{-y}` placeholder in the URL template, so long as the
* source does not have a custom tile grid. In this case,
* {@link module:ol/source/TileImage} can be used with a `tileUrlFunction`
* such as:
*
* tileUrlFunction: function(coordinate) {
* return 'http://mapserver.com/' + coordinate[0] + '/' +
* coordinate[1] + '/' + coordinate[2] + '.png';
* }
*
*
* @param {module:ol/source/XYZ~Options=} opt_options XYZ options.
* @api
*/
constructor(opt_options) {
const options = opt_options || {};
+15 -14
View File
@@ -23,17 +23,17 @@ const TierSizeCalculation = {
};
/**
* @param {module:ol/tilegrid/TileGrid} tileGrid TileGrid that the tile belongs to.
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState} state State.
* @param {string} src Image source URI.
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
* @param {module:ol/Tile~Options=} opt_options Tile options.
*/
export class CustomTile extends ImageTile {
/**
* @param {module:ol/tilegrid/TileGrid} tileGrid TileGrid that the tile belongs to.
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
* @param {module:ol/TileState} state State.
* @param {string} src Image source URI.
* @param {?string} crossOrigin Cross origin.
* @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function.
* @param {module:ol/Tile~Options=} opt_options Tile options.
*/
constructor(tileGrid, tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) {
super(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options);
@@ -115,15 +115,16 @@ CustomTile.prototype.getImage = function() {
*/
/**
* @classdesc
* Layer source for tile data in Zoomify format (both Zoomify and Internet
* Imaging Protocol are supported).
* @api
*/
class Zoomify extends TileImage {
/**
* @classdesc
* Layer source for tile data in Zoomify format (both Zoomify and Internet
* Imaging Protocol are supported).
*
* @param {module:ol/source/Zoomify~Options=} opt_options Options.
* @api
*/
constructor(opt_options) {