From 1a5cf52b610bb87bec54341d1d15220f22e835d2 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 17 Jul 2018 23:43:10 -0600 Subject: [PATCH] Remove remaining use of inherits in src --- src/ol/layer/Base.js | 34 +++++++------- src/ol/layer/Group.js | 28 ++++++------ src/ol/layer/Heatmap.js | 32 ++++++------- src/ol/layer/Image.js | 34 +++++++------- src/ol/layer/Layer.js | 50 ++++++++++---------- src/ol/layer/Tile.js | 34 +++++++------- src/ol/layer/Vector.js | 32 ++++++------- src/ol/layer/VectorTile.js | 30 ++++++------ src/ol/render/Box.js | 14 +++--- src/ol/render/Event.js | 23 +++++----- src/ol/render/canvas/ImageReplay.js | 29 ++++++------ src/ol/render/canvas/Immediate.js | 42 ++++++++--------- src/ol/render/canvas/LineStringReplay.js | 29 ++++++------ src/ol/render/canvas/PolygonReplay.js | 29 ++++++------ src/ol/render/canvas/Replay.js | 28 ++++++------ src/ol/render/canvas/ReplayGroup.js | 32 ++++++------- src/ol/render/canvas/TextReplay.js | 29 ++++++------ src/ol/render/webgl/CircleReplay.js | 20 ++++---- src/ol/render/webgl/ImageReplay.js | 20 ++++---- src/ol/render/webgl/Immediate.js | 30 ++++++------ src/ol/render/webgl/LineStringReplay.js | 20 ++++---- src/ol/render/webgl/PolygonReplay.js | 20 ++++---- src/ol/render/webgl/Replay.js | 22 ++++----- src/ol/render/webgl/ReplayGroup.js | 22 ++++----- src/ol/render/webgl/TextReplay.js | 20 ++++---- src/ol/render/webgl/TextureReplay.js | 22 ++++----- src/ol/reproj/Image.js | 36 +++++++-------- src/ol/reproj/Tile.js | 46 +++++++++---------- src/ol/source/BingMaps.js | 24 +++++----- src/ol/source/CartoDB.js | 24 +++++----- src/ol/source/Cluster.js | 28 ++++++------ src/ol/source/Image.js | 56 +++++++++++------------ src/ol/source/ImageArcGISRest.js | 36 +++++++-------- src/ol/source/ImageCanvas.js | 24 +++++----- src/ol/source/ImageMapGuide.js | 26 +++++------ src/ol/source/ImageStatic.js | 24 +++++----- src/ol/source/ImageWMS.js | 26 +++++------ src/ol/source/OSM.js | 24 +++++----- src/ol/source/Raster.js | 58 +++++++++++------------- src/ol/source/Source.js | 34 +++++++------- src/ol/source/Stamen.js | 24 +++++----- src/ol/source/Tile.js | 36 +++++++-------- src/ol/source/TileArcGISRest.js | 32 ++++++------- src/ol/source/TileDebug.js | 52 ++++++++++----------- src/ol/source/TileImage.js | 26 +++++------ src/ol/source/TileJSON.js | 24 +++++----- src/ol/source/TileWMS.js | 24 +++++----- src/ol/source/UTFGrid.js | 30 ++++++------ src/ol/source/UrlTile.js | 26 +++++------ src/ol/source/Vector.js | 36 +++++++-------- src/ol/source/VectorTile.js | 38 ++++++++-------- src/ol/source/WMTS.js | 24 +++++----- src/ol/source/XYZ.js | 50 ++++++++++---------- src/ol/source/Zoomify.js | 32 ++++++------- src/ol/structs/LRUCache.js | 28 ++++++------ src/ol/style/Circle.js | 24 +++++----- src/ol/style/Icon.js | 24 +++++----- src/ol/style/IconImage.js | 26 +++++------ src/ol/style/RegularShape.js | 28 ++++++------ src/ol/tilegrid/WMTS.js | 28 +++++------- src/ol/webgl/Context.js | 4 +- src/ol/webgl/Fragment.js | 6 +-- src/ol/webgl/Vertex.js | 6 +-- 63 files changed, 837 insertions(+), 982 deletions(-) diff --git a/src/ol/layer/Base.js b/src/ol/layer/Base.js index 1f2bb3f7aa..48a2a8e705 100644 --- a/src/ol/layer/Base.js +++ b/src/ol/layer/Base.js @@ -23,24 +23,24 @@ import {assign} from '../obj.js'; */ -/** - * @classdesc - * Abstract base class; normally only used for creating subclasses and not - * instantiated in apps. - * Note that with {@link module:ol/layer/Base} and all its subclasses, any property set in - * the options is set as a {@link module:ol/Object} property on the layer object, so - * is observable, and has get/set accessors. - * - * @constructor - * @abstract - * @extends {module:ol/Object} - * @param {module:ol/layer/Base~Options} options Layer options. - * @api - */ -class BaseLayer { +class BaseLayer extends BaseObject { + /** + * @classdesc + * Abstract base class; normally only used for creating subclasses and not + * instantiated in apps. + * Note that with {@link module:ol/layer/Base} and all its subclasses, any property set in + * the options is set as a {@link module:ol/Object} property on the layer object, so + * is observable, and has get/set accessors. + * + * @constructor + * @abstract + * @extends {module:ol/Object} + * @param {module:ol/layer/Base~Options} options Layer options. + * @api + */ constructor(options) { - BaseObject.call(this); + super(); /** * @type {Object.} @@ -249,7 +249,5 @@ class BaseLayer { } } -inherits(BaseLayer, BaseObject); - export default BaseLayer; diff --git a/src/ol/layer/Group.js b/src/ol/layer/Group.js index 411c078d61..4b68fb48b3 100644 --- a/src/ol/layer/Group.js +++ b/src/ol/layer/Group.js @@ -40,18 +40,18 @@ const Property = { }; -/** - * @classdesc - * A {@link module:ol/Collection~Collection} of layers that are handled together. - * - * A generic `change` event is triggered when the group/Collection changes. - * - * @constructor - * @extends {module:ol/layer/Base} - * @param {module:ol/layer/Group~Options=} opt_options Layer options. - * @api - */ -class LayerGroup { +class LayerGroup extends BaseLayer { + /** + * @classdesc + * A {@link module:ol/Collection~Collection} of layers that are handled together. + * + * A generic `change` event is triggered when the group/Collection changes. + * + * @constructor + * @extends {module:ol/layer/Base} + * @param {module:ol/layer/Group~Options=} opt_options Layer options. + * @api + */ constructor(opt_options) { const options = opt_options || {}; @@ -60,7 +60,7 @@ class LayerGroup { let layers = options.layers; - BaseLayer.call(this, baseOptions); + super(baseOptions); /** * @private @@ -236,7 +236,5 @@ class LayerGroup { } } -inherits(LayerGroup, BaseLayer); - export default LayerGroup; diff --git a/src/ol/layer/Heatmap.js b/src/ol/layer/Heatmap.js index e8fe57bd70..7df2be2043 100644 --- a/src/ol/layer/Heatmap.js +++ b/src/ol/layer/Heatmap.js @@ -60,20 +60,20 @@ const Property = { const DEFAULT_GRADIENT = ['#00f', '#0ff', '#0f0', '#ff0', '#f00']; -/** - * @classdesc - * Layer for rendering vector data as a heatmap. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} - * property on the layer object; for example, setting `title: 'My Title'` in the - * options means that `title` is observable, and has get/set accessors. - * - * @constructor - * @extends {module:ol/layer/Vector} - * @fires module:ol/render/Event~RenderEvent - * @param {module:ol/layer/Heatmap~Options=} opt_options Options. - * @api - */ -class Heatmap { +class Heatmap extends VectorLayer { + /** + * @classdesc + * Layer for rendering vector data as a heatmap. + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * property on the layer object; for example, setting `title: 'My Title'` in the + * options means that `title` is observable, and has get/set accessors. + * + * @constructor + * @extends {module:ol/layer/Vector} + * @fires module:ol/render/Event~RenderEvent + * @param {module:ol/layer/Heatmap~Options=} opt_options Options. + * @api + */ constructor(opt_options) { const options = opt_options ? opt_options : {}; @@ -84,7 +84,7 @@ class Heatmap { delete baseOptions.blur; delete baseOptions.shadow; delete baseOptions.weight; - VectorLayer.call(this, /** @type {module:ol/layer/Vector~Options} */ (baseOptions)); + super(baseOptions); /** * @private @@ -283,8 +283,6 @@ class Heatmap { } } -inherits(Heatmap, VectorLayer); - /** * @param {Array.} colors A list of colored. diff --git a/src/ol/layer/Image.js b/src/ol/layer/Image.js index 3b09138dfe..9828ab8043 100644 --- a/src/ol/layer/Image.js +++ b/src/ol/layer/Image.js @@ -26,25 +26,25 @@ import Layer from '../layer/Layer.js'; */ -/** - * @classdesc - * Server-rendered images that are available for arbitrary extents and - * resolutions. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} - * property on the layer object; for example, setting `title: 'My Title'` in the - * options means that `title` is observable, and has get/set accessors. - * - * @constructor - * @extends {module:ol/layer/Layer} - * @fires module:ol/render/Event~RenderEvent - * @param {module:ol/layer/Image~Options=} opt_options Layer options. - * @api - */ -class ImageLayer { +class ImageLayer extends Layer { + /** + * @classdesc + * Server-rendered images that are available for arbitrary extents and + * resolutions. + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * property on the layer object; for example, setting `title: 'My Title'` in the + * options means that `title` is observable, and has get/set accessors. + * + * @constructor + * @extends {module:ol/layer/Layer} + * @fires module:ol/render/Event~RenderEvent + * @param {module:ol/layer/Image~Options=} opt_options Layer options. + * @api + */ constructor(opt_options) { const options = opt_options ? opt_options : {}; - Layer.call(this, /** @type {module:ol/layer/Layer~Options} */ (options)); + super(options); /** * The layer type. @@ -57,8 +57,6 @@ class ImageLayer { } -inherits(ImageLayer, Layer); - /** * Return the associated {@link module:ol/source/Image source} of the image layer. diff --git a/src/ol/layer/Layer.js b/src/ol/layer/Layer.js index d3a2a80aef..aff9ea4495 100644 --- a/src/ol/layer/Layer.js +++ b/src/ol/layer/Layer.js @@ -44,35 +44,35 @@ import SourceState from '../source/State.js'; */ -/** - * @classdesc - * Abstract base class; normally only used for creating subclasses and not - * instantiated in apps. - * A visual representation of raster or vector map data. - * Layers group together those properties that pertain to how the data is to be - * displayed, irrespective of the source of that data. - * - * Layers are usually added to a map with {@link module:ol/Map#addLayer}. Components - * like {@link module:ol/interaction/Select~Select} use unmanaged layers - * internally. These unmanaged layers are associated with the map using - * {@link module:ol/layer/Layer~Layer#setMap} instead. - * - * A generic `change` event is fired when the state of the source changes. - * - * @constructor - * @abstract - * @extends {module:ol/layer/Base} - * @fires module:ol/render/Event~RenderEvent - * @param {module:ol/layer/Layer~Options} options Layer options. - * @api - */ -class Layer { +class Layer extends BaseLayer { + /** + * @classdesc + * Abstract base class; normally only used for creating subclasses and not + * instantiated in apps. + * A visual representation of raster or vector map data. + * Layers group together those properties that pertain to how the data is to be + * displayed, irrespective of the source of that data. + * + * Layers are usually added to a map with {@link module:ol/Map#addLayer}. Components + * like {@link module:ol/interaction/Select~Select} use unmanaged layers + * internally. These unmanaged layers are associated with the map using + * {@link module:ol/layer/Layer~Layer#setMap} instead. + * + * A generic `change` event is fired when the state of the source changes. + * + * @constructor + * @abstract + * @extends {module:ol/layer/Base} + * @fires module:ol/render/Event~RenderEvent + * @param {module:ol/layer/Layer~Options} options Layer options. + * @api + */ constructor(options) { const baseOptions = assign({}, options); delete baseOptions.source; - BaseLayer.call(this, /** @type {module:ol/layer/Base~Options} */ (baseOptions)); + super(baseOptions); /** * @private @@ -214,8 +214,6 @@ class Layer { } } -inherits(Layer, BaseLayer); - /** * Return `true` if the layer is visible, and if the passed resolution is diff --git a/src/ol/layer/Tile.js b/src/ol/layer/Tile.js index f1b504e4e6..ba74bb3311 100644 --- a/src/ol/layer/Tile.js +++ b/src/ol/layer/Tile.js @@ -31,21 +31,21 @@ import {assign} from '../obj.js'; */ -/** - * @classdesc - * For layer sources that provide pre-rendered, tiled images in grids that are - * organized by zoom levels for specific resolutions. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} - * property on the layer object; for example, setting `title: 'My Title'` in the - * options means that `title` is observable, and has get/set accessors. - * - * @constructor - * @extends {module:ol/layer/Layer} - * @fires module:ol/render/Event~RenderEvent - * @param {module:ol/layer/Tile~Options=} opt_options Tile layer options. - * @api - */ -class TileLayer { +class TileLayer extends Layer { + /** + * @classdesc + * For layer sources that provide pre-rendered, tiled images in grids that are + * organized by zoom levels for specific resolutions. + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * property on the layer object; for example, setting `title: 'My Title'` in the + * options means that `title` is observable, and has get/set accessors. + * + * @constructor + * @extends {module:ol/layer/Layer} + * @fires module:ol/render/Event~RenderEvent + * @param {module:ol/layer/Tile~Options=} opt_options Tile layer options. + * @api + */ constructor(opt_options) { const options = opt_options ? opt_options : {}; @@ -53,7 +53,7 @@ class TileLayer { delete baseOptions.preload; delete baseOptions.useInterimTilesOnError; - Layer.call(this, /** @type {module:ol/layer/Layer~Options} */ (baseOptions)); + super(baseOptions); this.setPreload(options.preload !== undefined ? options.preload : 0); this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ? @@ -109,8 +109,6 @@ class TileLayer { } } -inherits(TileLayer, Layer); - /** * Return the associated {@link module:ol/source/Tile tilesource} of the layer. diff --git a/src/ol/layer/Vector.js b/src/ol/layer/Vector.js index 7cd627e21b..5ddcdc5b19 100644 --- a/src/ol/layer/Vector.js +++ b/src/ol/layer/Vector.js @@ -78,20 +78,20 @@ const Property = { }; -/** - * @classdesc - * Vector data that is rendered client-side. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} - * property on the layer object; for example, setting `title: 'My Title'` in the - * options means that `title` is observable, and has get/set accessors. - * - * @constructor - * @extends {module:ol/layer/Layer} - * @fires module:ol/render/Event~RenderEvent - * @param {module:ol/layer/Vector~Options=} opt_options Options. - * @api - */ -class VectorLayer { +class VectorLayer extends Layer { + /** + * @classdesc + * Vector data that is rendered client-side. + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * property on the layer object; for example, setting `title: 'My Title'` in the + * options means that `title` is observable, and has get/set accessors. + * + * @constructor + * @extends {module:ol/layer/Layer} + * @fires module:ol/render/Event~RenderEvent + * @param {module:ol/layer/Vector~Options=} opt_options Options. + * @api + */ constructor(opt_options) { const options = opt_options ? opt_options : /** @type {module:ol/layer/Vector~Options} */ ({}); @@ -102,7 +102,7 @@ class VectorLayer { delete baseOptions.renderBuffer; delete baseOptions.updateWhileAnimating; delete baseOptions.updateWhileInteracting; - Layer.call(this, /** @type {module:ol/layer/Layer~Options} */ (baseOptions)); + super(baseOptions); /** * @private @@ -263,8 +263,6 @@ class VectorLayer { } } -inherits(VectorLayer, Layer); - /** * Return the associated {@link module:ol/source/Vector vectorsource} of the layer. diff --git a/src/ol/layer/VectorTile.js b/src/ol/layer/VectorTile.js index 20d7453d88..0afe3ed466 100644 --- a/src/ol/layer/VectorTile.js +++ b/src/ol/layer/VectorTile.js @@ -87,19 +87,19 @@ export const RenderType = { */ -/** - * @classdesc - * Layer for vector tile data that is rendered client-side. - * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} - * property on the layer object; for example, setting `title: 'My Title'` in the - * options means that `title` is observable, and has get/set accessors. - * - * @constructor - * @extends {module:ol/layer/Vector} - * @param {module:ol/layer/VectorTile~Options=} opt_options Options. - * @api - */ -class VectorTileLayer { +class VectorTileLayer extends VectorLayer { + /** + * @classdesc + * Layer for vector tile data that is rendered client-side. + * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject} + * property on the layer object; for example, setting `title: 'My Title'` in the + * options means that `title` is observable, and has get/set accessors. + * + * @constructor + * @extends {module:ol/layer/Vector} + * @param {module:ol/layer/VectorTile~Options=} opt_options Options. + * @api + */ constructor(opt_options) { const options = opt_options ? opt_options : {}; @@ -118,7 +118,7 @@ class VectorTileLayer { delete baseOptions.preload; delete baseOptions.useInterimTilesOnError; - VectorLayer.call(this, /** @type {module:ol/layer/Vector~Options} */ (baseOptions)); + super(baseOptions); this.setPreload(options.preload ? options.preload : 0); this.setUseInterimTilesOnError(options.useInterimTilesOnError !== undefined ? @@ -174,8 +174,6 @@ class VectorTileLayer { } } -inherits(VectorTileLayer, VectorLayer); - /** * Return the associated {@link module:ol/source/VectorTile vectortilesource} of the layer. diff --git a/src/ol/render/Box.js b/src/ol/render/Box.js index 63dce4bc66..f51afd682b 100644 --- a/src/ol/render/Box.js +++ b/src/ol/render/Box.js @@ -7,12 +7,12 @@ import {inherits} from '../util.js'; import Disposable from '../Disposable.js'; import Polygon from '../geom/Polygon.js'; -/** - * @constructor - * @extends {module:ol/Disposable} - * @param {string} className CSS class name. - */ -class RenderBox { +class RenderBox extends Disposable { + /** + * @constructor + * @extends {module:ol/Disposable} + * @param {string} className CSS class name. + */ constructor(className) { /** @@ -126,7 +126,5 @@ class RenderBox { } } -inherits(RenderBox, Disposable); - export default RenderBox; diff --git a/src/ol/render/Event.js b/src/ol/render/Event.js index ff1052dfd3..4bab695a7d 100644 --- a/src/ol/render/Event.js +++ b/src/ol/render/Event.js @@ -4,20 +4,20 @@ import {inherits} from '../util.js'; import Event from '../events/Event.js'; -/** - * @constructor - * @extends {module:ol/events/Event} - * @param {module:ol/render/EventType} type Type. - * @param {module:ol/render/VectorContext=} opt_vectorContext Vector context. - * @param {module:ol/PluggableMap~FrameState=} opt_frameState Frame state. - * @param {?CanvasRenderingContext2D=} opt_context Context. - * @param {?module:ol/webgl/Context=} opt_glContext WebGL Context. - */ -class RenderEvent { +class RenderEvent extends Event { + /** + * @constructor + * @extends {module:ol/events/Event} + * @param {module:ol/render/EventType} type Type. + * @param {module:ol/render/VectorContext=} opt_vectorContext Vector context. + * @param {module:ol/PluggableMap~FrameState=} opt_frameState Frame state. + * @param {?CanvasRenderingContext2D=} opt_context Context. + * @param {?module:ol/webgl/Context=} opt_glContext WebGL Context. + */ constructor(type, opt_vectorContext, opt_frameState, opt_context, opt_glContext) { - Event.call(this, type); + super(type); /** * For canvas, this is an instance of {@link module:ol/render/canvas/Immediate}. @@ -53,5 +53,4 @@ class RenderEvent { } -inherits(RenderEvent, Event); export default RenderEvent; diff --git a/src/ol/render/canvas/ImageReplay.js b/src/ol/render/canvas/ImageReplay.js index 8d6f325637..c348f22e7d 100644 --- a/src/ol/render/canvas/ImageReplay.js +++ b/src/ol/render/canvas/ImageReplay.js @@ -5,21 +5,20 @@ import {inherits} from '../../util.js'; import CanvasInstruction from '../canvas/Instruction.js'; import CanvasReplay from '../canvas/Replay.js'; -/** - * @constructor - * @extends {module:ol/render/canvas/Replay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Maximum extent. - * @param {number} resolution Resolution. - * @param {number} pixelRatio Pixel ratio. - * @param {boolean} overlaps The replay can have overlapping geometries. - * @param {?} declutterTree Declutter tree. - * @struct - */ -class CanvasImageReplay { +class CanvasImageReplay extends CanvasReplay { + /** + * @constructor + * @extends {module:ol/render/canvas/Replay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Maximum extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {boolean} overlaps The replay can have overlapping geometries. + * @param {?} declutterTree Declutter tree. + * @struct + */ constructor(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree) { - CanvasReplay.call(this, - tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); + super(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); /** * @private @@ -225,7 +224,5 @@ class CanvasImageReplay { } } -inherits(CanvasImageReplay, CanvasReplay); - export default CanvasImageReplay; diff --git a/src/ol/render/canvas/Immediate.js b/src/ol/render/canvas/Immediate.js index 8843869e91..dcc26ceace 100644 --- a/src/ol/render/canvas/Immediate.js +++ b/src/ol/render/canvas/Immediate.js @@ -17,27 +17,27 @@ import VectorContext from '../VectorContext.js'; import {defaultTextAlign, defaultFillStyle, defaultLineCap, defaultLineDash, defaultLineDashOffset, defaultLineJoin, defaultLineWidth, defaultMiterLimit, defaultStrokeStyle, defaultTextBaseline, defaultFont} from '../canvas.js'; import {create as createTransform, compose as composeTransform} from '../../transform.js'; -/** - * @classdesc - * A concrete subclass of {@link module:ol/render/VectorContext} that implements - * direct rendering of features and geometries to an HTML5 Canvas context. - * Instances of this class are created internally by the library and - * provided to application code as vectorContext member of the - * {@link module:ol/render/Event~RenderEvent} object associated with postcompose, precompose and - * render events emitted by layers and maps. - * - * @constructor - * @extends {module:ol/render/VectorContext} - * @param {CanvasRenderingContext2D} context Context. - * @param {number} pixelRatio Pixel ratio. - * @param {module:ol/extent~Extent} extent Extent. - * @param {module:ol/transform~Transform} transform Transform. - * @param {number} viewRotation View rotation. - * @struct - */ -class CanvasImmediateRenderer { +class CanvasImmediateRenderer extends VectorContext { + /** + * @classdesc + * A concrete subclass of {@link module:ol/render/VectorContext} that implements + * direct rendering of features and geometries to an HTML5 Canvas context. + * Instances of this class are created internally by the library and + * provided to application code as vectorContext member of the + * {@link module:ol/render/Event~RenderEvent} object associated with postcompose, precompose and + * render events emitted by layers and maps. + * + * @constructor + * @extends {module:ol/render/VectorContext} + * @param {CanvasRenderingContext2D} context Context. + * @param {number} pixelRatio Pixel ratio. + * @param {module:ol/extent~Extent} extent Extent. + * @param {module:ol/transform~Transform} transform Transform. + * @param {number} viewRotation View rotation. + * @struct + */ constructor(context, pixelRatio, extent, transform, viewRotation) { - VectorContext.call(this); + super(); /** * @private @@ -943,7 +943,5 @@ class CanvasImmediateRenderer { } } -inherits(CanvasImmediateRenderer, VectorContext); - export default CanvasImmediateRenderer; diff --git a/src/ol/render/canvas/LineStringReplay.js b/src/ol/render/canvas/LineStringReplay.js index 1e99544fcc..c16abb9f57 100644 --- a/src/ol/render/canvas/LineStringReplay.js +++ b/src/ol/render/canvas/LineStringReplay.js @@ -5,21 +5,20 @@ import {inherits} from '../../util.js'; import CanvasInstruction, {strokeInstruction, beginPathInstruction} from '../canvas/Instruction.js'; import CanvasReplay from '../canvas/Replay.js'; -/** - * @constructor - * @extends {module:ol/render/canvas/Replay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Maximum extent. - * @param {number} resolution Resolution. - * @param {number} pixelRatio Pixel ratio. - * @param {boolean} overlaps The replay can have overlapping geometries. - * @param {?} declutterTree Declutter tree. - * @struct - */ -class CanvasLineStringReplay { +class CanvasLineStringReplay extends CanvasReplay { + /** + * @constructor + * @extends {module:ol/render/canvas/Replay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Maximum extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {boolean} overlaps The replay can have overlapping geometries. + * @param {?} declutterTree Declutter tree. + * @struct + */ constructor(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree) { - CanvasReplay.call(this, - tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); + super(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); } /** @@ -118,7 +117,5 @@ class CanvasLineStringReplay { } } -inherits(CanvasLineStringReplay, CanvasReplay); - export default CanvasLineStringReplay; diff --git a/src/ol/render/canvas/PolygonReplay.js b/src/ol/render/canvas/PolygonReplay.js index efb597f3dd..50c90e0aed 100644 --- a/src/ol/render/canvas/PolygonReplay.js +++ b/src/ol/render/canvas/PolygonReplay.js @@ -11,21 +11,20 @@ import CanvasInstruction, { import CanvasReplay from '../canvas/Replay.js'; -/** - * @constructor - * @extends {module:ol/render/canvas/Replay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Maximum extent. - * @param {number} resolution Resolution. - * @param {number} pixelRatio Pixel ratio. - * @param {boolean} overlaps The replay can have overlapping geometries. - * @param {?} declutterTree Declutter tree. - * @struct - */ -class CanvasPolygonReplay { +class CanvasPolygonReplay extends CanvasReplay { + /** + * @constructor + * @extends {module:ol/render/canvas/Replay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Maximum extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {boolean} overlaps The replay can have overlapping geometries. + * @param {?} declutterTree Declutter tree. + * @struct + */ constructor(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree) { - CanvasReplay.call(this, - tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); + super(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); } /** @@ -215,7 +214,5 @@ class CanvasPolygonReplay { } } -inherits(CanvasPolygonReplay, CanvasReplay); - export default CanvasPolygonReplay; diff --git a/src/ol/render/canvas/Replay.js b/src/ol/render/canvas/Replay.js index 65462a7118..8057993bf0 100644 --- a/src/ol/render/canvas/Replay.js +++ b/src/ol/render/canvas/Replay.js @@ -41,20 +41,20 @@ const tmpExtent = createEmpty(); const tmpTransform = createTransform(); -/** - * @constructor - * @extends {module:ol/render/VectorContext} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Maximum extent. - * @param {number} resolution Resolution. - * @param {number} pixelRatio Pixel ratio. - * @param {boolean} overlaps The replay can have overlapping geometries. - * @param {?} declutterTree Declutter tree. - * @struct - */ -class CanvasReplay { +class CanvasReplay extends VectorContext { + /** + * @constructor + * @extends {module:ol/render/VectorContext} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Maximum extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {boolean} overlaps The replay can have overlapping geometries. + * @param {?} declutterTree Declutter tree. + * @struct + */ constructor(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree) { - VectorContext.call(this); + super(); /** * @type {?} @@ -1082,8 +1082,6 @@ class CanvasReplay { } } -inherits(CanvasReplay, VectorContext); - /** * FIXME empty description for jsdoc diff --git a/src/ol/render/canvas/ReplayGroup.js b/src/ol/render/canvas/ReplayGroup.js index 2aa3f5cfeb..53077b3cfc 100644 --- a/src/ol/render/canvas/ReplayGroup.js +++ b/src/ol/render/canvas/ReplayGroup.js @@ -33,20 +33,20 @@ const BATCH_CONSTRUCTORS = { }; -/** - * @constructor - * @extends {module:ol/render/ReplayGroup} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @param {number} resolution Resolution. - * @param {number} pixelRatio Pixel ratio. - * @param {boolean} overlaps The replay group can have overlapping geometries. - * @param {?} declutterTree Declutter tree - * for declutter processing in postrender. - * @param {number=} opt_renderBuffer Optional rendering buffer. - * @struct - */ -class CanvasReplayGroup { +class CanvasReplayGroup extends ReplayGroup { + /** + * @constructor + * @extends {module:ol/render/ReplayGroup} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {boolean} overlaps The replay group can have overlapping geometries. + * @param {?} declutterTree Declutter tree + * for declutter processing in postrender. + * @param {number=} opt_renderBuffer Optional rendering buffer. + * @struct + */ constructor( tolerance, maxExtent, @@ -56,7 +56,7 @@ class CanvasReplayGroup { declutterTree, opt_renderBuffer ) { - ReplayGroup.call(this); + super(); /** * Declutter tree. @@ -407,8 +407,6 @@ class CanvasReplayGroup { } } -inherits(CanvasReplayGroup, ReplayGroup); - /** * This cache is used for storing calculated pixel circles for increasing performance. diff --git a/src/ol/render/canvas/TextReplay.js b/src/ol/render/canvas/TextReplay.js index 945243bad1..5c9db8771d 100644 --- a/src/ol/render/canvas/TextReplay.js +++ b/src/ol/render/canvas/TextReplay.js @@ -14,21 +14,20 @@ import CanvasReplay from '../canvas/Replay.js'; import {TEXT_ALIGN} from '../replay.js'; import TextPlacement from '../../style/TextPlacement.js'; -/** - * @constructor - * @extends {module:ol/render/canvas/Replay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Maximum extent. - * @param {number} resolution Resolution. - * @param {number} pixelRatio Pixel ratio. - * @param {boolean} overlaps The replay can have overlapping geometries. - * @param {?} declutterTree Declutter tree. - * @struct - */ -class CanvasTextReplay { +class CanvasTextReplay extends CanvasReplay { + /** + * @constructor + * @extends {module:ol/render/canvas/Replay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Maximum extent. + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {boolean} overlaps The replay can have overlapping geometries. + * @param {?} declutterTree Declutter tree. + * @struct + */ constructor(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree) { - CanvasReplay.call(this, - tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); + super(tolerance, maxExtent, resolution, pixelRatio, overlaps, declutterTree); /** * @private @@ -521,8 +520,6 @@ class CanvasTextReplay { } } -inherits(CanvasTextReplay, CanvasReplay); - /** * @param {string} font Font to use for measuring. diff --git a/src/ol/render/webgl/CircleReplay.js b/src/ol/render/webgl/CircleReplay.js index 6d98db4d2c..1a7f02f8c7 100644 --- a/src/ol/render/webgl/CircleReplay.js +++ b/src/ol/render/webgl/CircleReplay.js @@ -15,16 +15,16 @@ import {DEFAULT_LINEDASH, DEFAULT_LINEDASHOFFSET, DEFAULT_STROKESTYLE, import {FLOAT} from '../../webgl.js'; import WebGLBuffer from '../../webgl/Buffer.js'; -/** - * @constructor - * @extends {module:ol/render/webgl/Replay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @struct - */ -class WebGLCircleReplay { +class WebGLCircleReplay extends WebGLReplay { + /** + * @constructor + * @extends {module:ol/render/webgl/Replay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @struct + */ constructor(tolerance, maxExtent) { - WebGLReplay.call(this, tolerance, maxExtent); + super(tolerance, maxExtent); /** * @private @@ -404,7 +404,5 @@ class WebGLCircleReplay { } } -inherits(WebGLCircleReplay, WebGLReplay); - export default WebGLCircleReplay; diff --git a/src/ol/render/webgl/ImageReplay.js b/src/ol/render/webgl/ImageReplay.js index 03f6350fdf..4570ab2da0 100644 --- a/src/ol/render/webgl/ImageReplay.js +++ b/src/ol/render/webgl/ImageReplay.js @@ -5,16 +5,16 @@ import {getUid, inherits} from '../../util.js'; import WebGLTextureReplay from '../webgl/TextureReplay.js'; import WebGLBuffer from '../../webgl/Buffer.js'; -/** - * @constructor - * @extends {module:ol/render/webgl/TextureReplay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @struct - */ -class WebGLImageReplay { +class WebGLImageReplay extends WebGLTextureReplay { + /** + * @constructor + * @extends {module:ol/render/webgl/TextureReplay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @struct + */ constructor(tolerance, maxExtent) { - WebGLTextureReplay.call(this, tolerance, maxExtent); + super(tolerance, maxExtent); /** * @type {Array.} @@ -163,7 +163,5 @@ class WebGLImageReplay { } } -inherits(WebGLImageReplay, WebGLTextureReplay); - export default WebGLImageReplay; diff --git a/src/ol/render/webgl/Immediate.js b/src/ol/render/webgl/Immediate.js index ef281f2510..415e7779bd 100644 --- a/src/ol/render/webgl/Immediate.js +++ b/src/ol/render/webgl/Immediate.js @@ -8,21 +8,21 @@ import ReplayType from '../ReplayType.js'; import VectorContext from '../VectorContext.js'; import WebGLReplayGroup from '../webgl/ReplayGroup.js'; -/** - * @constructor - * @extends {module:ol/render/VectorContext} - * @param {module:ol/webgl/Context} context Context. - * @param {module:ol/coordinate~Coordinate} center Center. - * @param {number} resolution Resolution. - * @param {number} rotation Rotation. - * @param {module:ol/size~Size} size Size. - * @param {module:ol/extent~Extent} extent Extent. - * @param {number} pixelRatio Pixel ratio. - * @struct - */ -class WebGLImmediateRenderer { +class WebGLImmediateRenderer extends VectorContext { + /** + * @constructor + * @extends {module:ol/render/VectorContext} + * @param {module:ol/webgl/Context} context Context. + * @param {module:ol/coordinate~Coordinate} center Center. + * @param {number} resolution Resolution. + * @param {number} rotation Rotation. + * @param {module:ol/size~Size} size Size. + * @param {module:ol/extent~Extent} extent Extent. + * @param {number} pixelRatio Pixel ratio. + * @struct + */ constructor(context, center, resolution, rotation, size, extent, pixelRatio) { - VectorContext.call(this); + super(); /** * @private @@ -385,7 +385,5 @@ class WebGLImmediateRenderer { } } -inherits(WebGLImmediateRenderer, VectorContext); - export default WebGLImmediateRenderer; diff --git a/src/ol/render/webgl/LineStringReplay.js b/src/ol/render/webgl/LineStringReplay.js index db18c94472..bd089f0a4e 100644 --- a/src/ol/render/webgl/LineStringReplay.js +++ b/src/ol/render/webgl/LineStringReplay.js @@ -35,16 +35,16 @@ const Instruction = { }; -/** - * @constructor - * @extends {module:ol/render/webgl/Replay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @struct - */ -class WebGLLineStringReplay { +class WebGLLineStringReplay extends WebGLReplay { + /** + * @constructor + * @extends {module:ol/render/webgl/Replay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @struct + */ constructor(tolerance, maxExtent) { - WebGLReplay.call(this, tolerance, maxExtent); + super(tolerance, maxExtent); /** * @private @@ -666,7 +666,5 @@ class WebGLLineStringReplay { } } -inherits(WebGLLineStringReplay, WebGLReplay); - export default WebGLLineStringReplay; diff --git a/src/ol/render/webgl/PolygonReplay.js b/src/ol/render/webgl/PolygonReplay.js index 14bb136170..424b97ee60 100644 --- a/src/ol/render/webgl/PolygonReplay.js +++ b/src/ol/render/webgl/PolygonReplay.js @@ -36,16 +36,16 @@ import WebGLBuffer from '../../webgl/Buffer.js'; */ -/** - * @constructor - * @extends {module:ol/render/webgl/Replay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @struct - */ -class WebGLPolygonReplay { +class WebGLPolygonReplay extends WebGLReplay { + /** + * @constructor + * @extends {module:ol/render/webgl/Replay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @struct + */ constructor(tolerance, maxExtent) { - WebGLReplay.call(this, tolerance, maxExtent); + super(tolerance, maxExtent); this.lineStringReplay = new WebGLLineStringReplay( tolerance, maxExtent); @@ -1045,7 +1045,5 @@ class WebGLPolygonReplay { } } -inherits(WebGLPolygonReplay, WebGLReplay); - export default WebGLPolygonReplay; diff --git a/src/ol/render/webgl/Replay.js b/src/ol/render/webgl/Replay.js index f3c6b83f7c..743fcce134 100644 --- a/src/ol/render/webgl/Replay.js +++ b/src/ol/render/webgl/Replay.js @@ -15,17 +15,17 @@ import {create, fromTransform} from '../../vec/mat4.js'; import {ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, TRIANGLES, UNSIGNED_INT, UNSIGNED_SHORT} from '../../webgl.js'; -/** - * @constructor - * @abstract - * @extends {module:ol/render/VectorContext} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @struct - */ -class WebGLReplay { +class WebGLReplay extends VectorContext { + /** + * @constructor + * @abstract + * @extends {module:ol/render/VectorContext} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @struct + */ constructor(tolerance, maxExtent) { - VectorContext.call(this); + super(); /** * @protected @@ -359,7 +359,5 @@ class WebGLReplay { } } -inherits(WebGLReplay, VectorContext); - export default WebGLReplay; diff --git a/src/ol/render/webgl/ReplayGroup.js b/src/ol/render/webgl/ReplayGroup.js index 3bf6cc030a..0a18839434 100644 --- a/src/ol/render/webgl/ReplayGroup.js +++ b/src/ol/render/webgl/ReplayGroup.js @@ -32,17 +32,17 @@ const BATCH_CONSTRUCTORS = { }; -/** - * @constructor - * @extends {module:ol/render/ReplayGroup} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @param {number=} opt_renderBuffer Render buffer. - * @struct - */ -class WebGLReplayGroup { +class WebGLReplayGroup extends ReplayGroup { + /** + * @constructor + * @extends {module:ol/render/ReplayGroup} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @param {number=} opt_renderBuffer Render buffer. + * @struct + */ constructor(tolerance, maxExtent, opt_renderBuffer) { - ReplayGroup.call(this); + super(); /** * @type {module:ol/extent~Extent} @@ -341,7 +341,5 @@ class WebGLReplayGroup { } } -inherits(WebGLReplayGroup, ReplayGroup); - export default WebGLReplayGroup; diff --git a/src/ol/render/webgl/TextReplay.js b/src/ol/render/webgl/TextReplay.js index 7f4e9a37db..2d9214fab1 100644 --- a/src/ol/render/webgl/TextReplay.js +++ b/src/ol/render/webgl/TextReplay.js @@ -22,16 +22,16 @@ import WebGLBuffer from '../../webgl/Buffer.js'; */ -/** - * @constructor - * @extends {module:ol/render/webgl/TextureReplay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @struct - */ -class WebGLTextReplay { +class WebGLTextReplay extends WebGLTextureReplay { + /** + * @constructor + * @extends {module:ol/render/webgl/TextureReplay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @struct + */ constructor(tolerance, maxExtent) { - WebGLTextureReplay.call(this, tolerance, maxExtent); + super(tolerance, maxExtent); /** * @private @@ -457,7 +457,5 @@ class WebGLTextReplay { } } -inherits(WebGLTextReplay, WebGLTextureReplay); - export default WebGLTextReplay; diff --git a/src/ol/render/webgl/TextureReplay.js b/src/ol/render/webgl/TextureReplay.js index 3ce621d0b3..f2d95a2eed 100644 --- a/src/ol/render/webgl/TextureReplay.js +++ b/src/ol/render/webgl/TextureReplay.js @@ -10,17 +10,17 @@ import WebGLReplay from '../webgl/Replay.js'; import {CLAMP_TO_EDGE, FLOAT, TEXTURE_2D} from '../../webgl.js'; import {createTexture} from '../../webgl/Context.js'; -/** - * @constructor - * @abstract - * @extends {module:ol/render/webgl/Replay} - * @param {number} tolerance Tolerance. - * @param {module:ol/extent~Extent} maxExtent Max extent. - * @struct - */ -class WebGLTextureReplay { +class WebGLTextureReplay extends WebGLReplay { + /** + * @constructor + * @abstract + * @extends {module:ol/render/webgl/Replay} + * @param {number} tolerance Tolerance. + * @param {module:ol/extent~Extent} maxExtent Max extent. + * @struct + */ constructor(tolerance, maxExtent) { - WebGLReplay.call(this, tolerance, maxExtent); + super(tolerance, maxExtent); /** * @type {number|undefined} @@ -478,7 +478,5 @@ class WebGLTextureReplay { getHitDetectionTextures() {} } -inherits(WebGLTextureReplay, WebGLReplay); - export default WebGLTextureReplay; diff --git a/src/ol/reproj/Image.js b/src/ol/reproj/Image.js index 4fc11ccec8..d084b46064 100644 --- a/src/ol/reproj/Image.js +++ b/src/ol/reproj/Image.js @@ -17,22 +17,22 @@ import Triangulation from '../reproj/Triangulation.js'; */ -/** - * @classdesc - * Class encapsulating single reprojected image. - * See {@link module:ol/source/Image~ImageSource}. - * - * @constructor - * @extends {module:ol/ImageBase} - * @param {module:ol/proj/Projection} sourceProj Source projection (of the data). - * @param {module:ol/proj/Projection} targetProj Target projection. - * @param {module:ol/extent~Extent} targetExtent Target extent. - * @param {number} targetResolution Target resolution. - * @param {number} pixelRatio Pixel ratio. - * @param {module:ol/reproj/Image~FunctionType} getImageFunction - * Function returning source images (extent, resolution, pixelRatio). - */ -class ReprojImage { +class ReprojImage extends ImageBase { + /** + * @classdesc + * Class encapsulating single reprojected image. + * See {@link module:ol/source/Image~ImageSource}. + * + * @constructor + * @extends {module:ol/ImageBase} + * @param {module:ol/proj/Projection} sourceProj Source projection (of the data). + * @param {module:ol/proj/Projection} targetProj Target projection. + * @param {module:ol/extent~Extent} targetExtent Target extent. + * @param {number} targetResolution Target resolution. + * @param {number} pixelRatio Pixel ratio. + * @param {module:ol/reproj/Image~FunctionType} getImageFunction + * Function returning source images (extent, resolution, pixelRatio). + */ constructor( sourceProj, targetProj, @@ -119,7 +119,7 @@ class ReprojImage { state = ImageState.IDLE; } - ImageBase.call(this, targetExtent, targetResolution, this.sourcePixelRatio_, state); + super(targetExtent, targetResolution, this.sourcePixelRatio_, state); } /** @@ -200,7 +200,5 @@ class ReprojImage { } } -inherits(ReprojImage, ImageBase); - export default ReprojImage; diff --git a/src/ol/reproj/Tile.js b/src/ol/reproj/Tile.js index c399cabacf..a038169edf 100644 --- a/src/ol/reproj/Tile.js +++ b/src/ol/reproj/Tile.js @@ -18,27 +18,27 @@ import Triangulation from '../reproj/Triangulation.js'; */ -/** - * @classdesc - * Class encapsulating single reprojected tile. - * See {@link module:ol/source/TileImage~TileImage}. - * - * @constructor - * @extends {module:ol/Tile} - * @param {module:ol/proj/Projection} sourceProj Source projection. - * @param {module:ol/tilegrid/TileGrid} sourceTileGrid Source tile grid. - * @param {module:ol/proj/Projection} targetProj Target projection. - * @param {module:ol/tilegrid/TileGrid} targetTileGrid Target tile grid. - * @param {module:ol/tilecoord~TileCoord} tileCoord Coordinate of the tile. - * @param {module:ol/tilecoord~TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X. - * @param {number} pixelRatio Pixel ratio. - * @param {number} gutter Gutter of the source tiles. - * @param {module:ol/reproj/Tile~FunctionType} getTileFunction - * Function returning source tiles (z, x, y, pixelRatio). - * @param {number=} opt_errorThreshold Acceptable reprojection error (in px). - * @param {boolean=} opt_renderEdges Render reprojection edges. - */ -class ReprojTile { +class ReprojTile extends Tile { + /** + * @classdesc + * Class encapsulating single reprojected tile. + * See {@link module:ol/source/TileImage~TileImage}. + * + * @constructor + * @extends {module:ol/Tile} + * @param {module:ol/proj/Projection} sourceProj Source projection. + * @param {module:ol/tilegrid/TileGrid} sourceTileGrid Source tile grid. + * @param {module:ol/proj/Projection} targetProj Target projection. + * @param {module:ol/tilegrid/TileGrid} targetTileGrid Target tile grid. + * @param {module:ol/tilecoord~TileCoord} tileCoord Coordinate of the tile. + * @param {module:ol/tilecoord~TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X. + * @param {number} pixelRatio Pixel ratio. + * @param {number} gutter Gutter of the source tiles. + * @param {module:ol/reproj/Tile~FunctionType} getTileFunction + * Function returning source tiles (z, x, y, pixelRatio). + * @param {number=} opt_errorThreshold Acceptable reprojection error (in px). + * @param {boolean=} opt_renderEdges Render reprojection edges. + */ constructor( sourceProj, sourceTileGrid, @@ -52,7 +52,7 @@ class ReprojTile { opt_errorThreshold, opt_renderEdges ) { - Tile.call(this, tileCoord, TileState.IDLE); + super(tileCoord, TileState.IDLE); /** * @private @@ -314,7 +314,5 @@ class ReprojTile { } } -inherits(ReprojTile, Tile); - export default ReprojTile; diff --git a/src/ol/source/BingMaps.js b/src/ol/source/BingMaps.js index aa86003fd3..de5ef5f186 100644 --- a/src/ol/source/BingMaps.js +++ b/src/ol/source/BingMaps.js @@ -44,16 +44,16 @@ const TOS_ATTRIBUTION = '} sources Input @@ -137,19 +135,19 @@ inherits(RasterSourceEvent, 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. - * - * @constructor - * @extends {module:ol/source/Image} - * @fires ol/source/Raster~RasterSourceEvent - * @param {module:ol/source/Raster~Options=} options Options. - * @api - */ -class RasterSource { +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. + * + * @constructor + * @extends {module:ol/source/Image} + * @fires ol/source/Raster~RasterSourceEvent + * @param {module:ol/source/Raster~Options=} options Options. + * @api + */ constructor(options) { /** @@ -245,7 +243,7 @@ class RasterSource { wantedTiles: {} }; - ImageSource.call(this, {}); + super({}); if (options.operation !== undefined) { this.setOperation(options.operation, options.lib); @@ -421,8 +419,6 @@ class RasterSource { } } -inherits(RasterSource, ImageSource); - /** * A reusable canvas context. diff --git a/src/ol/source/Source.js b/src/ol/source/Source.js index 7356008f40..84930b9afb 100644 --- a/src/ol/source/Source.js +++ b/src/ol/source/Source.js @@ -37,24 +37,24 @@ 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. - * - * @constructor - * @abstract - * @extends {module:ol/Object} - * @param {module:ol/source/Source~Options} options Source options. - * @api - */ -class Source { +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. + * + * @constructor + * @abstract + * @extends {module:ol/Object} + * @param {module:ol/source/Source~Options} options Source options. + * @api + */ constructor(options) { - BaseObject.call(this); + super(); /** * @private @@ -177,8 +177,6 @@ class Source { } } -inherits(Source, BaseObject); - /** * @param {module:ol/coordinate~Coordinate} coordinate Coordinate. * @param {number} resolution Resolution. diff --git a/src/ol/source/Stamen.js b/src/ol/source/Stamen.js index bfac063cd9..c75353f459 100644 --- a/src/ol/source/Stamen.js +++ b/src/ol/source/Stamen.js @@ -109,17 +109,17 @@ const ProviderConfig = { */ -/** - * @classdesc - * Layer source for the Stamen tile server. - * - * @constructor - * @extends {module:ol/source/XYZ} - * @param {module:ol/source/Stamen~Options=} options Stamen options. - * @api - */ -class Stamen { +class Stamen extends XYZ { + /** + * @classdesc + * Layer source for the Stamen tile server. + * + * @constructor + * @extends {module:ol/source/XYZ} + * @param {module:ol/source/Stamen~Options=} options Stamen options. + * @api + */ constructor(options) { const i = options.layer.indexOf('-'); const provider = i == -1 ? options.layer : options.layer.slice(0, i); @@ -131,7 +131,7 @@ class Stamen { 'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer + '/{z}/{x}/{y}.' + layerConfig.extension; - XYZ.call(this, { + super({ attributions: ATTRIBUTIONS, cacheSize: options.cacheSize, crossOrigin: 'anonymous', @@ -148,6 +148,4 @@ class Stamen { } -inherits(Stamen, XYZ); - export default Stamen; diff --git a/src/ol/source/Tile.js b/src/ol/source/Tile.js index 9c8854b89e..fd8623d7c9 100644 --- a/src/ol/source/Tile.js +++ b/src/ol/source/Tile.js @@ -27,22 +27,22 @@ 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. - * - * @constructor - * @abstract - * @extends {module:ol/source/Source} - * @param {module:ol/source/Tile~Options=} options SourceTile source options. - * @api - */ -class TileSource { +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. + * + * @constructor + * @abstract + * @extends {module:ol/source/Source} + * @param {module:ol/source/Tile~Options=} options SourceTile source options. + * @api + */ constructor(options) { - Source.call(this, { + super({ attributions: options.attributions, extent: options.extent, projection: options.projection, @@ -295,8 +295,6 @@ class TileSource { } } -inherits(TileSource, Source); - /** * Marks a tile coord as being used, without triggering a load. @@ -318,11 +316,11 @@ TileSource.prototype.useTile = UNDEFINED; * @param {string} type Type. * @param {module:ol/Tile} tile The tile. */ -export class TileSourceEvent { +export class TileSourceEvent extends Event { constructor(type, tile) { - Event.call(this, type); + super(type); /** * The tile related to the event. @@ -335,6 +333,4 @@ export class TileSourceEvent { } -inherits(TileSourceEvent, Event); - export default TileSource; diff --git a/src/ol/source/TileArcGISRest.js b/src/ol/source/TileArcGISRest.js index b06e72493c..a276b98326 100644 --- a/src/ol/source/TileArcGISRest.js +++ b/src/ol/source/TileArcGISRest.js @@ -51,25 +51,25 @@ 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. - * - * @constructor - * @extends {module:ol/source/TileImage} - * @param {module:ol/source/TileArcGISRest~Options=} opt_options Tile ArcGIS Rest options. - * @api - */ -class TileArcGISRest { +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. + * + * @constructor + * @extends {module:ol/source/TileImage} + * @param {module:ol/source/TileArcGISRest~Options=} opt_options Tile ArcGIS Rest options. + * @api + */ constructor(opt_options) { const options = opt_options || {}; - TileImage.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, @@ -216,7 +216,5 @@ class TileArcGISRest { } } -inherits(TileArcGISRest, TileImage); - export default TileArcGISRest; diff --git a/src/ol/source/TileDebug.js b/src/ol/source/TileDebug.js index 93e30bd1d4..07632b58a9 100644 --- a/src/ol/source/TileDebug.js +++ b/src/ol/source/TileDebug.js @@ -10,17 +10,17 @@ import TileSource from '../source/Tile.js'; import {getKeyZXY} from '../tilecoord.js'; -/** - * @constructor - * @extends {module:ol/Tile} - * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. - * @param {module:ol/size~Size} tileSize Tile size. - * @param {string} text Text. - */ -class LabeledTile { +class LabeledTile extends Tile { + /** + * @constructor + * @extends {module:ol/Tile} + * @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate. + * @param {module:ol/size~Size} tileSize Tile size. + * @param {string} text Text. + */ constructor(tileCoord, tileSize, text) { - Tile.call(this, tileCoord, TileState.LOADED); + super(tileCoord, TileState.LOADED); /** * @private @@ -73,8 +73,6 @@ class LabeledTile { load() {} } -inherits(LabeledTile, Tile); - /** * @typedef {Object} Options @@ -84,23 +82,23 @@ inherits(LabeledTile, 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. - * - * @constructor - * @extends {module:ol/source/Tile} - * @param {module:ol/source/TileDebug~Options=} options Debug tile options. - * @api - */ -class TileDebug { +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. + * + * @constructor + * @extends {module:ol/source/Tile} + * @param {module:ol/source/TileDebug~Options=} options Debug tile options. + * @api + */ constructor(options) { - TileSource.call(this, { + super({ opaque: false, projection: options.projection, tileGrid: options.tileGrid, @@ -129,7 +127,5 @@ class TileDebug { } } -inherits(TileDebug, TileSource); - export default TileDebug; diff --git a/src/ol/source/TileImage.js b/src/ol/source/TileImage.js index f59a06ec41..7e79507743 100644 --- a/src/ol/source/TileImage.js +++ b/src/ol/source/TileImage.js @@ -54,20 +54,20 @@ import {getForProjection as getTileGridForProjection} from '../tilegrid.js'; */ -/** - * @classdesc - * Base class for sources providing images divided into a tile grid. - * - * @constructor - * @fires module:ol/source/Tile~TileSourceEvent - * @extends {module:ol/source/UrlTile} - * @param {module:ol/source/TileImage~Options=} options Image tile options. - * @api - */ -class TileImage { +class TileImage extends UrlTile { + /** + * @classdesc + * Base class for sources providing images divided into a tile grid. + * + * @constructor + * @fires module:ol/source/Tile~TileSourceEvent + * @extends {module:ol/source/UrlTile} + * @param {module:ol/source/TileImage~Options=} options Image tile options. + * @api + */ constructor(options) { - UrlTile.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize, extent: options.extent, @@ -389,8 +389,6 @@ class TileImage { } } -inherits(TileImage, UrlTile); - /** * @param {module:ol/ImageTile} imageTile Image tile. diff --git a/src/ol/source/TileJSON.js b/src/ol/source/TileJSON.js index 7a6ee11678..354ecaadcd 100644 --- a/src/ol/source/TileJSON.js +++ b/src/ol/source/TileJSON.js @@ -44,16 +44,16 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js'; */ -/** - * @classdesc - * Layer source for tile data in TileJSON format. - * - * @constructor - * @extends {module:ol/source/TileImage} - * @param {module:ol/source/TileJSON~Options=} options TileJSON options. - * @api - */ -class TileJSON { +class TileJSON extends TileImage { + /** + * @classdesc + * Layer source for tile data in TileJSON format. + * + * @constructor + * @extends {module:ol/source/TileImage} + * @param {module:ol/source/TileJSON~Options=} options TileJSON options. + * @api + */ constructor(options) { /** @@ -62,7 +62,7 @@ class TileJSON { */ this.tileJSON_ = null; - TileImage.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, @@ -182,7 +182,5 @@ class TileJSON { } } -inherits(TileJSON, TileImage); - export default TileJSON; diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 1e053d19c0..849f4e1da1 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -71,16 +71,16 @@ import {appendParams} from '../uri.js'; */ -/** - * @classdesc - * Layer source for tile data from WMS servers. - * - * @constructor - * @extends {module:ol/source/TileImage} - * @param {module:ol/source/TileWMS~Options=} [opt_options] Tile WMS options. - * @api - */ -class TileWMS { +class TileWMS extends TileImage { + /** + * @classdesc + * Layer source for tile data from WMS servers. + * + * @constructor + * @extends {module:ol/source/TileImage} + * @param {module:ol/source/TileWMS~Options=} [opt_options] Tile WMS options. + * @api + */ constructor(opt_options) { const options = opt_options || {}; @@ -89,7 +89,7 @@ class TileWMS { const transparent = 'TRANSPARENT' in params ? params['TRANSPARENT'] : true; - TileImage.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, @@ -388,7 +388,5 @@ class TileWMS { } } -inherits(TileWMS, TileImage); - export default TileWMS; diff --git a/src/ol/source/UTFGrid.js b/src/ol/source/UTFGrid.js index a90baa5b6b..f763ec3e19 100644 --- a/src/ol/source/UTFGrid.js +++ b/src/ol/source/UTFGrid.js @@ -27,11 +27,11 @@ import {createXYZ, extentFromProjection} from '../tilegrid.js'; * @param {boolean} preemptive Load the tile when visible (before it's needed). * @param {boolean} jsonp Load the tile as a script. */ -export class CustomTile { +export class CustomTile extends Tile { constructor(tileCoord, state, src, extent, preemptive, jsonp) { - Tile.call(this, tileCoord, state); + super(tileCoord, state); /** * @private @@ -80,8 +80,6 @@ export class CustomTile { } -inherits(CustomTile, Tile); - /** * Get the image element for this tile. @@ -271,19 +269,19 @@ CustomTile.prototype.load = function() { */ -/** - * @classdesc - * Layer source for UTFGrid interaction data loaded from TileJSON format. - * - * @constructor - * @extends {module:ol/source/Tile} - * @param {module:ol/source/UTFGrid~Options=} options Source options. - * @api - */ -class UTFGrid { +class UTFGrid extends TileSource { + /** + * @classdesc + * Layer source for UTFGrid interaction data loaded from TileJSON format. + * + * @constructor + * @extends {module:ol/source/Tile} + * @param {module:ol/source/UTFGrid~Options=} options Source options. + * @api + */ constructor(options) { - TileSource.call(this, { + super({ projection: getProjection('EPSG:3857'), state: SourceState.LOADING }); @@ -334,8 +332,6 @@ class UTFGrid { } -inherits(UTFGrid, TileSource); - /** * @private diff --git a/src/ol/source/UrlTile.js b/src/ol/source/UrlTile.js index 542c376d61..b19f558f77 100644 --- a/src/ol/source/UrlTile.js +++ b/src/ol/source/UrlTile.js @@ -27,20 +27,20 @@ import {getKeyZXY} from '../tilecoord.js'; */ -/** - * @classdesc - * Base class for sources providing tiles divided into a tile grid over http. - * - * @constructor - * @abstract - * @fires module:ol/source/TileEvent - * @extends {module:ol/source/Tile} - * @param {module:ol/source/UrlTile~Options=} options Image tile options. - */ -class UrlTile { +class UrlTile extends TileSource { + /** + * @classdesc + * Base class for sources providing tiles divided into a tile grid over http. + * + * @constructor + * @abstract + * @fires module:ol/source/TileEvent + * @extends {module:ol/source/Tile} + * @param {module:ol/source/UrlTile~Options=} options Image tile options. + */ constructor(options) { - TileSource.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize, extent: options.extent, @@ -205,8 +205,6 @@ class UrlTile { } } -inherits(UrlTile, TileSource); - /** * @type {module:ol/Tile~UrlFunction|undefined} diff --git a/src/ol/source/Vector.js b/src/ol/source/Vector.js index 7b8fe888b9..3ef13cb11d 100644 --- a/src/ol/source/Vector.js +++ b/src/ol/source/Vector.js @@ -41,11 +41,11 @@ import RBush from '../structs/RBush.js'; * @param {string} type Type. * @param {module:ol/Feature=} opt_feature Feature. */ -export class VectorSourceEvent { +export class VectorSourceEvent extends Event { constructor(type, opt_feature) { - Event.call(this, type); + super(type); /** * The feature being added or removed. @@ -58,8 +58,6 @@ export class VectorSourceEvent { } -inherits(VectorSourceEvent, Event); - /** * @typedef {Object} Options @@ -151,25 +149,25 @@ inherits(VectorSourceEvent, 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. - * - * @constructor - * @extends {module:ol/source/Source} - * @fires ol/source/Vector~VectorSourceEvent - * @param {module:ol/source/Vector~Options=} opt_options Vector source options. - * @api - */ -class VectorSource { +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. + * + * @constructor + * @extends {module:ol/source/Source} + * @fires ol/source/Vector~VectorSourceEvent + * @param {module:ol/source/Vector~Options=} opt_options Vector source options. + * @api + */ constructor(opt_options) { const options = opt_options || {}; - Source.call(this, { + super({ attributions: options.attributions, projection: undefined, state: SourceState.READY, @@ -282,8 +280,6 @@ class VectorSource { } -inherits(VectorSource, Source); - /** * Add a single feature to the source. If you want to add a batch of features diff --git a/src/ol/source/VectorTile.js b/src/ol/source/VectorTile.js index a38ae74645..e1c1158596 100644 --- a/src/ol/source/VectorTile.js +++ b/src/ol/source/VectorTile.js @@ -58,24 +58,24 @@ 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. - * - * @constructor - * @fires module:ol/source/Tile~TileSourceEvent - * @extends {module:ol/source/UrlTile} - * @param {module:ol/source/VectorTile~Options=} options Vector tile options. - * @api - */ -class VectorTile { +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. + * + * @constructor + * @fires module:ol/source/Tile~TileSourceEvent + * @extends {module:ol/source/UrlTile} + * @param {module:ol/source/VectorTile~Options=} options Vector tile options. + * @api + */ constructor(options) { const projection = options.projection || 'EPSG:3857'; @@ -88,7 +88,7 @@ class VectorTile { tileSize: options.tileSize || 512 }); - UrlTile.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize !== undefined ? options.cacheSize : 128, extent: extent, @@ -139,8 +139,6 @@ class VectorTile { } -inherits(VectorTile, UrlTile); - /** * @return {boolean} The source can have overlapping geometries. diff --git a/src/ol/source/WMTS.js b/src/ol/source/WMTS.js index 7a4a0c99a5..f309b09d53 100644 --- a/src/ol/source/WMTS.js +++ b/src/ol/source/WMTS.js @@ -56,17 +56,17 @@ import {appendParams} from '../uri.js'; */ -/** - * @classdesc - * Layer source for tile data from WMTS servers. - * - * @constructor - * @extends {module:ol/source/TileImage} - * @param {module:ol/source/WMTS~Options=} options WMTS options. - * @api - */ -class WMTS { +class WMTS extends TileImage { + /** + * @classdesc + * Layer source for tile data from WMTS servers. + * + * @constructor + * @extends {module:ol/source/TileImage} + * @param {module:ol/source/WMTS~Options=} options WMTS options. + * @api + */ constructor(options) { // TODO: add support for TileMatrixLimits @@ -199,7 +199,7 @@ class WMTS { const tileUrlFunction = (urls && urls.length > 0) ? createFromTileUrlFunctions(urls.map(this.createFromWMTSTemplate_)) : nullTileUrlFunction; - TileImage.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, @@ -221,8 +221,6 @@ class WMTS { } -inherits(WMTS, TileImage); - /** * Set the URLs to use for requests. * URLs may contain OCG conform URL Template Variables: {TileMatrix}, {TileRow}, {TileCol}. diff --git a/src/ol/source/XYZ.js b/src/ol/source/XYZ.js index 6f2b90996c..b5a1590485 100644 --- a/src/ol/source/XYZ.js +++ b/src/ol/source/XYZ.js @@ -44,30 +44,30 @@ 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'; - * } - * - * - * @constructor - * @extends {module:ol/source/TileImage} - * @param {module:ol/source/XYZ~Options=} opt_options XYZ options. - * @api - */ -class XYZ { +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'; + * } + * + * + * @constructor + * @extends {module:ol/source/TileImage} + * @param {module:ol/source/XYZ~Options=} opt_options XYZ options. + * @api + */ constructor(opt_options) { const options = opt_options || {}; const projection = options.projection !== undefined ? @@ -81,7 +81,7 @@ class XYZ { tileSize: options.tileSize }); - TileImage.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, @@ -102,6 +102,4 @@ class XYZ { } -inherits(XYZ, TileImage); - export default XYZ; diff --git a/src/ol/source/Zoomify.js b/src/ol/source/Zoomify.js index 6917422764..b8a0818d51 100644 --- a/src/ol/source/Zoomify.js +++ b/src/ol/source/Zoomify.js @@ -34,11 +34,11 @@ const TierSizeCalculation = { * @param {module:ol/Tile~LoadFunction} tileLoadFunction Tile load function. * @param {module:ol/Tile~Options=} opt_options Tile options. */ -export class CustomTile { +export class CustomTile extends ImageTile { constructor(tileGrid, tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) { - ImageTile.call(this, tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options); + super(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options); /** * @private @@ -56,8 +56,6 @@ export class CustomTile { } -inherits(CustomTile, ImageTile); - /** * @inheritDoc @@ -119,18 +117,18 @@ CustomTile.prototype.getImage = function() { */ -/** - * @classdesc - * Layer source for tile data in Zoomify format (both Zoomify and Internet - * Imaging Protocol are supported). - * - * @constructor - * @extends {module:ol/source/TileImage} - * @param {module:ol/source/Zoomify~Options=} opt_options Options. - * @api - */ -class Zoomify { +class Zoomify extends TileImage { + /** + * @classdesc + * Layer source for tile data in Zoomify format (both Zoomify and Internet + * Imaging Protocol are supported). + * + * @constructor + * @extends {module:ol/source/TileImage} + * @param {module:ol/source/Zoomify~Options=} opt_options Options. + * @api + */ constructor(opt_options) { const options = opt_options || {}; @@ -245,7 +243,7 @@ class Zoomify { const ZoomifyTileClass = CustomTile.bind(null, tileGrid); - TileImage.call(this, { + super({ attributions: options.attributions, cacheSize: options.cacheSize, crossOrigin: options.crossOrigin, @@ -261,6 +259,4 @@ class Zoomify { } -inherits(Zoomify, TileImage); - export default Zoomify; diff --git a/src/ol/structs/LRUCache.js b/src/ol/structs/LRUCache.js index bfa20ad27b..e3a90ec94e 100644 --- a/src/ol/structs/LRUCache.js +++ b/src/ol/structs/LRUCache.js @@ -16,22 +16,22 @@ import EventType from '../events/EventType.js'; */ -/** - * Implements a Least-Recently-Used cache where the keys do not conflict with - * Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring - * items from the cache is the responsibility of the user. - * @constructor - * @extends {module:ol/events/EventTarget} - * @fires module:ol/events/Event~Event - * @struct - * @template T - * @param {number=} opt_highWaterMark High water mark. - */ -class LRUCache { +class LRUCache extends EventTarget { + /** + * Implements a Least-Recently-Used cache where the keys do not conflict with + * Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring + * items from the cache is the responsibility of the user. + * @constructor + * @extends {module:ol/events/EventTarget} + * @fires module:ol/events/Event~Event + * @struct + * @template T + * @param {number=} opt_highWaterMark High water mark. + */ constructor(opt_highWaterMark) { - EventTarget.call(this); + super(); /** * @type {number} @@ -298,6 +298,4 @@ class LRUCache { } -inherits(LRUCache, EventTarget); - export default LRUCache; diff --git a/src/ol/style/Circle.js b/src/ol/style/Circle.js index 5851760cb7..a79fbc7c9c 100644 --- a/src/ol/style/Circle.js +++ b/src/ol/style/Circle.js @@ -20,21 +20,21 @@ import RegularShape from '../style/RegularShape.js'; */ -/** - * @classdesc - * Set circle style for vector features. - * - * @constructor - * @param {module:ol/style/Circle~Options=} opt_options Options. - * @extends {module:ol/style/RegularShape} - * @api - */ -class CircleStyle { +class CircleStyle extends RegularShape { + /** + * @classdesc + * Set circle style for vector features. + * + * @constructor + * @param {module:ol/style/Circle~Options=} opt_options Options. + * @extends {module:ol/style/RegularShape} + * @api + */ constructor(opt_options) { const options = opt_options || {}; - RegularShape.call(this, { + super({ points: Infinity, fill: options.fill, radius: options.radius, @@ -76,7 +76,5 @@ class CircleStyle { } } -inherits(CircleStyle, RegularShape); - export default CircleStyle; diff --git a/src/ol/style/Icon.js b/src/ol/style/Icon.js index 50f60e3cc7..715125fa27 100644 --- a/src/ol/style/Icon.js +++ b/src/ol/style/Icon.js @@ -52,16 +52,16 @@ import ImageStyle from '../style/Image.js'; */ -/** - * @classdesc - * Set icon style for vector features. - * - * @constructor - * @param {module:ol/style/Icon~Options=} opt_options Options. - * @extends {module:ol/style/Image} - * @api - */ -class Icon { +class Icon extends ImageStyle { + /** + * @classdesc + * Set icon style for vector features. + * + * @constructor + * @param {module:ol/style/Icon~Options=} opt_options Options. + * @extends {module:ol/style/Image} + * @api + */ constructor(opt_options) { const options = opt_options || {}; @@ -203,7 +203,7 @@ class Icon { const snapToPixel = options.snapToPixel !== undefined ? options.snapToPixel : true; - ImageStyle.call(this, { + super({ opacity: opacity, rotation: rotation, scale: scale, @@ -418,7 +418,5 @@ class Icon { } } -inherits(Icon, ImageStyle); - export default Icon; diff --git a/src/ol/style/IconImage.js b/src/ol/style/IconImage.js index 4f677a6b51..194eb443c1 100644 --- a/src/ol/style/IconImage.js +++ b/src/ol/style/IconImage.js @@ -9,20 +9,20 @@ import EventType from '../events/EventType.js'; import ImageState from '../ImageState.js'; import {shared as iconImageCache} from '../style/IconImageCache.js'; -/** - * @constructor - * @param {HTMLImageElement|HTMLCanvasElement} image Image. - * @param {string|undefined} src Src. - * @param {module:ol/size~Size} size Size. - * @param {?string} crossOrigin Cross origin. - * @param {module:ol/ImageState} imageState Image state. - * @param {module:ol/color~Color} color Color. - * @extends {module:ol/events/EventTarget} - */ -class IconImage { +class IconImage extends EventTarget { + /** + * @constructor + * @param {HTMLImageElement|HTMLCanvasElement} image Image. + * @param {string|undefined} src Src. + * @param {module:ol/size~Size} size Size. + * @param {?string} crossOrigin Cross origin. + * @param {module:ol/ImageState} imageState Image state. + * @param {module:ol/color~Color} color Color. + * @extends {module:ol/events/EventTarget} + */ constructor(image, src, size, crossOrigin, imageState, color) { - EventTarget.call(this); + super(); /** * @private @@ -241,8 +241,6 @@ class IconImage { } } -inherits(IconImage, EventTarget); - /** * @param {HTMLImageElement|HTMLCanvasElement} image Image. diff --git a/src/ol/style/RegularShape.js b/src/ol/style/RegularShape.js index 4b786d9902..c3efe8bca2 100644 --- a/src/ol/style/RegularShape.js +++ b/src/ol/style/RegularShape.js @@ -46,18 +46,18 @@ import ImageStyle from '../style/Image.js'; */ -/** - * @classdesc - * Set regular shape style for vector features. The resulting shape will be - * a regular polygon when `radius` is provided, or a star when `radius1` and - * `radius2` are provided. - * - * @constructor - * @param {module:ol/style/RegularShape~Options} options Options. - * @extends {module:ol/style/Image} - * @api - */ -class RegularShape { +class RegularShape extends ImageStyle { + /** + * @classdesc + * Set regular shape style for vector features. The resulting shape will be + * a regular polygon when `radius` is provided, or a star when `radius1` and + * `radius2` are provided. + * + * @constructor + * @param {module:ol/style/RegularShape~Options} options Options. + * @extends {module:ol/style/Image} + * @api + */ constructor(options) { /** * @private @@ -164,7 +164,7 @@ class RegularShape { const rotateWithView = options.rotateWithView !== undefined ? options.rotateWithView : false; - ImageStyle.call(this, { + super({ opacity: 1, rotateWithView: rotateWithView, rotation: options.rotation !== undefined ? options.rotation : 0, @@ -591,7 +591,5 @@ class RegularShape { } } -inherits(RegularShape, ImageStyle); - export default RegularShape; diff --git a/src/ol/tilegrid/WMTS.js b/src/ol/tilegrid/WMTS.js index 6fc2dd9178..972b357017 100644 --- a/src/ol/tilegrid/WMTS.js +++ b/src/ol/tilegrid/WMTS.js @@ -45,26 +45,24 @@ import TileGrid from '../tilegrid/TileGrid.js'; */ -/** - * @classdesc - * Set the grid pattern for sources accessing WMTS tiled-image servers. - * - * @constructor - * @extends {module:ol/tilegrid/TileGrid} - * @param {module:ol/tilegrid/WMTS~Options} options WMTS options. - * @struct - * @api - */ -class WMTSTileGrid { +class WMTSTileGrid extends TileGrid { + /** + * @classdesc + * Set the grid pattern for sources accessing WMTS tiled-image servers. + * + * @constructor + * @extends {module:ol/tilegrid/TileGrid} + * @param {module:ol/tilegrid/WMTS~Options} options WMTS options. + * @struct + * @api + */ constructor(options) { /** * @private * @type {!Array.} */ this.matrixIds_ = options.matrixIds; - // FIXME: should the matrixIds become optional? - - TileGrid.call(this, { + super({ extent: options.extent, origin: options.origin, origins: options.origins, @@ -93,8 +91,6 @@ class WMTSTileGrid { } } -inherits(WMTSTileGrid, TileGrid); - export default WMTSTileGrid; diff --git a/src/ol/webgl/Context.js b/src/ol/webgl/Context.js index ed04d45e6a..bb90bf3ee9 100644 --- a/src/ol/webgl/Context.js +++ b/src/ol/webgl/Context.js @@ -24,7 +24,7 @@ import ContextEventType from '../webgl/ContextEventType.js'; * * @extends {module:ol/Disposable} */ -class WebGLContext { +class WebGLContext extends Disposable { /** * @param {HTMLCanvasElement} canvas Canvas. @@ -305,8 +305,6 @@ class WebGLContext { } } -inherits(WebGLContext, Disposable); - /** * @param {WebGLRenderingContext} gl WebGL rendering context. diff --git a/src/ol/webgl/Fragment.js b/src/ol/webgl/Fragment.js index 809f5726d0..3b27053d40 100644 --- a/src/ol/webgl/Fragment.js +++ b/src/ol/webgl/Fragment.js @@ -8,13 +8,13 @@ import WebGLShader from '../webgl/Shader.js'; /** * @extends {module:ol/webgl/Shader} */ -class WebGLFragment { +class WebGLFragment extends WebGLShader { /** * @param {string} source Source. */ constructor(source) { - WebGLShader.call(this, source); + super(source); } /** @@ -25,7 +25,5 @@ class WebGLFragment { } } -inherits(WebGLFragment, WebGLShader); - export default WebGLFragment; diff --git a/src/ol/webgl/Vertex.js b/src/ol/webgl/Vertex.js index eadd8dd316..494b972387 100644 --- a/src/ol/webgl/Vertex.js +++ b/src/ol/webgl/Vertex.js @@ -8,13 +8,13 @@ import WebGLShader from '../webgl/Shader.js'; /** * @extends {module:ol/webgl/Shader} */ -class WebGLVertex { +class WebGLVertex extends WebGLShader { /** * @param {string} source Source. */ constructor(source) { - WebGLShader.call(this, source); + super(source); } /** @@ -25,7 +25,5 @@ class WebGLVertex { } } -inherits(WebGLVertex, WebGLShader); - export default WebGLVertex;