Harmonize jsdoc

This commit is contained in:
Simon Seyock
2021-02-02 11:44:44 +01:00
parent d6d18d46a8
commit f590cb3473
26 changed files with 86 additions and 86 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import View from '../src/ol/View.js';
/** /**
* Renders a progress bar. * Renders a progress bar.
* @param {HTMLElement} el The target element. * @param {HTMLElement} el The target element.
* @constructor * @class
*/ */
function Progress(el) { function Progress(el) {
this.el = el; this.el = el;
+1 -1
View File
@@ -6,7 +6,7 @@ import XYZ from '../src/ol/source/XYZ.js';
/** /**
* Renders a progress bar. * Renders a progress bar.
* @param {HTMLElement} el The target element. * @param {HTMLElement} el The target element.
* @constructor * @class
*/ */
function Progress(el) { function Progress(el) {
this.el = el; this.el = el;
+10 -10
View File
@@ -329,7 +329,7 @@ class ScaleLine extends Control {
* @param {number} width The current width of the scalebar. * @param {number} width The current width of the scalebar.
* @param {number} scale The current scale. * @param {number} scale The current scale.
* @param {string} suffix The suffix to append to the scale text. * @param {string} suffix The suffix to append to the scale text.
* @returns {string} The stringified HTML of the scalebar. * @return {string} The stringified HTML of the scalebar.
*/ */
createScaleBar(width, scale, suffix) { createScaleBar(width, scale, suffix) {
const mapScale = const mapScale =
@@ -400,9 +400,9 @@ class ScaleLine extends Control {
/** /**
* Creates a marker at given position * Creates a marker at given position
* @param {string} position - The position, absolute or relative * @param {string} position The position, absolute or relative
* @param {number} i - The iterator * @param {number} i The iterator
* @returns {string} The stringified div containing the marker * @return {string} The stringified div containing the marker
*/ */
createMarker(position, i) { createMarker(position, i) {
const top = position === 'absolute' ? 3 : -10; const top = position === 'absolute' ? 3 : -10;
@@ -421,12 +421,12 @@ class ScaleLine extends Control {
/** /**
* Creates the label for a marker marker at given position * Creates the label for a marker marker at given position
* @param {number} i - The iterator * @param {number} i The iterator
* @param {number} width - The width the scalebar will currently use * @param {number} width The width the scalebar will currently use
* @param {boolean} isLast - Flag indicating if we add the last step text * @param {boolean} isLast Flag indicating if we add the last step text
* @param {number} scale - The current scale for the whole scalebar * @param {number} scale The current scale for the whole scalebar
* @param {string} suffix - The suffix for the scale * @param {string} suffix The suffix for the scale
* @returns {string} The stringified div containing the step text * @return {string} The stringified div containing the step text
*/ */
createStepText(i, width, isLast, scale, suffix) { createStepText(i, width, isLast, scale, suffix) {
const length = const length =
+1 -1
View File
@@ -72,7 +72,7 @@ export function replaceNode(newNode, oldNode) {
/** /**
* @param {Node} node The node to remove. * @param {Node} node The node to remove.
* @returns {Node} The node that was removed or null. * @return {Node} The node that was removed or null.
*/ */
export function removeNode(node) { export function removeNode(node) {
return node && node.parentNode ? node.parentNode.removeChild(node) : null; return node && node.parentNode ? node.parentNode.removeChild(node) : null;
+1 -1
View File
@@ -356,7 +356,7 @@ class GML2 extends GMLBase {
/** /**
* @param {string} namespaceURI XML namespace. * @param {string} namespaceURI XML namespace.
* @returns {Element} coordinates node. * @return {Element} coordinates node.
* @private * @private
*/ */
createCoordinatesNode_(namespaceURI) { createCoordinatesNode_(namespaceURI) {
+5 -5
View File
@@ -327,7 +327,7 @@ class IIIFInfo {
} }
/** /**
* @returns {Versions} Major IIIF version. * @return {Versions} Major IIIF version.
* @api * @api
*/ */
getImageApiVersion() { getImageApiVersion() {
@@ -364,7 +364,7 @@ class IIIFInfo {
/** /**
* @param {Versions} version Optional IIIF image API version * @param {Versions} version Optional IIIF image API version
* @returns {string} Compliance level as it appears in the IIIF image information * @return {string} Compliance level as it appears in the IIIF image information
* response. * response.
*/ */
getComplianceLevelEntryFromProfile(version) { getComplianceLevelEntryFromProfile(version) {
@@ -407,7 +407,7 @@ class IIIFInfo {
/** /**
* @param {Versions} version Optional IIIF image API version * @param {Versions} version Optional IIIF image API version
* @returns {string} Compliance level, on of 'level0', 'level1' or 'level2' or undefined * @return {string} Compliance level, on of 'level0', 'level1' or 'level2' or undefined
*/ */
getComplianceLevelFromProfile(version) { getComplianceLevelFromProfile(version) {
const complianceLevel = this.getComplianceLevelEntryFromProfile(version); const complianceLevel = this.getComplianceLevelEntryFromProfile(version);
@@ -419,7 +419,7 @@ class IIIFInfo {
} }
/** /**
* @returns {SupportedFeatures} Image formats, qualities and region / size calculation * @return {SupportedFeatures} Image formats, qualities and region / size calculation
* methods that are supported by the IIIF service. * methods that are supported by the IIIF service.
*/ */
getComplianceLevelSupportedFeatures() { getComplianceLevelSupportedFeatures() {
@@ -436,7 +436,7 @@ class IIIFInfo {
/** /**
* @param {PreferredOptions=} opt_preferredOptions Optional options for preferred format and quality. * @param {PreferredOptions=} opt_preferredOptions Optional options for preferred format and quality.
* @returns {import("../source/IIIF.js").Options} IIIF tile source ready constructor options. * @return {import("../source/IIIF.js").Options} IIIF tile source ready constructor options.
* @api * @api
*/ */
getTileSourceOptions(opt_preferredOptions) { getTileSourceOptions(opt_preferredOptions) {
+1 -1
View File
@@ -814,7 +814,7 @@ function writeOgcFidFilter(node, fid, objectStack) {
/** /**
* @param {string|undefined} featurePrefix The prefix of the feature. * @param {string|undefined} featurePrefix The prefix of the feature.
* @param {string} featureType The type of the feature. * @param {string} featureType The type of the feature.
* @returns {string} The value of the typeName property. * @return {string} The value of the typeName property.
*/ */
function getTypeName(featurePrefix, featureType) { function getTypeName(featurePrefix, featureType) {
featurePrefix = featurePrefix ? featurePrefix : FEATURE_PREFIX; featurePrefix = featurePrefix ? featurePrefix : FEATURE_PREFIX;
+19 -19
View File
@@ -26,7 +26,7 @@ import Within from './filter/Within.js';
* Create a logical `<And>` operator between two or more filter conditions. * Create a logical `<And>` operator between two or more filter conditions.
* *
* @param {...import("./filter/Filter.js").default} conditions Filter conditions. * @param {...import("./filter/Filter.js").default} conditions Filter conditions.
* @returns {!And} `<And>` operator. * @return {!And} `<And>` operator.
* @api * @api
*/ */
export function and(conditions) { export function and(conditions) {
@@ -38,7 +38,7 @@ export function and(conditions) {
* Create a logical `<Or>` operator between two or more filter conditions. * Create a logical `<Or>` operator between two or more filter conditions.
* *
* @param {...import("./filter/Filter.js").default} conditions Filter conditions. * @param {...import("./filter/Filter.js").default} conditions Filter conditions.
* @returns {!Or} `<Or>` operator. * @return {!Or} `<Or>` operator.
* @api * @api
*/ */
export function or(conditions) { export function or(conditions) {
@@ -50,7 +50,7 @@ export function or(conditions) {
* Represents a logical `<Not>` operator for a filter condition. * Represents a logical `<Not>` operator for a filter condition.
* *
* @param {!import("./filter/Filter.js").default} condition Filter condition. * @param {!import("./filter/Filter.js").default} condition Filter condition.
* @returns {!Not} `<Not>` operator. * @return {!Not} `<Not>` operator.
* @api * @api
*/ */
export function not(condition) { export function not(condition) {
@@ -65,7 +65,7 @@ export function not(condition) {
* @param {!import("../extent.js").Extent} extent Extent. * @param {!import("../extent.js").Extent} extent Extent.
* @param {string=} opt_srsName SRS name. No srsName attribute will be * @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided. * set on geometries when this is not provided.
* @returns {!Bbox} `<BBOX>` operator. * @return {!Bbox} `<BBOX>` operator.
* @api * @api
*/ */
export function bbox(geometryName, extent, opt_srsName) { export function bbox(geometryName, extent, opt_srsName) {
@@ -80,7 +80,7 @@ export function bbox(geometryName, extent, opt_srsName) {
* @param {!import("../geom/Geometry.js").default} geometry Geometry. * @param {!import("../geom/Geometry.js").default} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be * @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided. * set on geometries when this is not provided.
* @returns {!Contains} `<Contains>` operator. * @return {!Contains} `<Contains>` operator.
* @api * @api
*/ */
export function contains(geometryName, geometry, opt_srsName) { export function contains(geometryName, geometry, opt_srsName) {
@@ -95,7 +95,7 @@ export function contains(geometryName, geometry, opt_srsName) {
* @param {!import("../geom/Geometry.js").default} geometry Geometry. * @param {!import("../geom/Geometry.js").default} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be * @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided. * set on geometries when this is not provided.
* @returns {!Intersects} `<Intersects>` operator. * @return {!Intersects} `<Intersects>` operator.
* @api * @api
*/ */
export function intersects(geometryName, geometry, opt_srsName) { export function intersects(geometryName, geometry, opt_srsName) {
@@ -110,7 +110,7 @@ export function intersects(geometryName, geometry, opt_srsName) {
* @param {!import("../geom/Geometry.js").default} geometry Geometry. * @param {!import("../geom/Geometry.js").default} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be * @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided. * set on geometries when this is not provided.
* @returns {!Disjoint} `<Disjoint>` operator. * @return {!Disjoint} `<Disjoint>` operator.
* @api * @api
*/ */
export function disjoint(geometryName, geometry, opt_srsName) { export function disjoint(geometryName, geometry, opt_srsName) {
@@ -125,7 +125,7 @@ export function disjoint(geometryName, geometry, opt_srsName) {
* @param {!import("../geom/Geometry.js").default} geometry Geometry. * @param {!import("../geom/Geometry.js").default} geometry Geometry.
* @param {string=} opt_srsName SRS name. No srsName attribute will be * @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided. * set on geometries when this is not provided.
* @returns {!Within} `<Within>` operator. * @return {!Within} `<Within>` operator.
* @api * @api
*/ */
export function within(geometryName, geometry, opt_srsName) { export function within(geometryName, geometry, opt_srsName) {
@@ -142,7 +142,7 @@ export function within(geometryName, geometry, opt_srsName) {
* @param {!string} unit Unit. * @param {!string} unit Unit.
* @param {string=} opt_srsName SRS name. No srsName attribute will be * @param {string=} opt_srsName SRS name. No srsName attribute will be
* set on geometries when this is not provided. * set on geometries when this is not provided.
* @returns {!DWithin} `<DWithin>` operator. * @return {!DWithin} `<DWithin>` operator.
* @api * @api
*/ */
export function dwithin(geometryName, geometry, distance, unit, opt_srsName) { export function dwithin(geometryName, geometry, distance, unit, opt_srsName) {
@@ -155,7 +155,7 @@ export function dwithin(geometryName, geometry, distance, unit, opt_srsName) {
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @param {!(string|number)} expression The value to compare. * @param {!(string|number)} expression The value to compare.
* @param {boolean=} opt_matchCase Case-sensitive? * @param {boolean=} opt_matchCase Case-sensitive?
* @returns {!EqualTo} `<PropertyIsEqualTo>` operator. * @return {!EqualTo} `<PropertyIsEqualTo>` operator.
* @api * @api
*/ */
export function equalTo(propertyName, expression, opt_matchCase) { export function equalTo(propertyName, expression, opt_matchCase) {
@@ -168,7 +168,7 @@ export function equalTo(propertyName, expression, opt_matchCase) {
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @param {!(string|number)} expression The value to compare. * @param {!(string|number)} expression The value to compare.
* @param {boolean=} opt_matchCase Case-sensitive? * @param {boolean=} opt_matchCase Case-sensitive?
* @returns {!NotEqualTo} `<PropertyIsNotEqualTo>` operator. * @return {!NotEqualTo} `<PropertyIsNotEqualTo>` operator.
* @api * @api
*/ */
export function notEqualTo(propertyName, expression, opt_matchCase) { export function notEqualTo(propertyName, expression, opt_matchCase) {
@@ -180,7 +180,7 @@ export function notEqualTo(propertyName, expression, opt_matchCase) {
* *
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare. * @param {!number} expression The value to compare.
* @returns {!LessThan} `<PropertyIsLessThan>` operator. * @return {!LessThan} `<PropertyIsLessThan>` operator.
* @api * @api
*/ */
export function lessThan(propertyName, expression) { export function lessThan(propertyName, expression) {
@@ -192,7 +192,7 @@ export function lessThan(propertyName, expression) {
* *
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare. * @param {!number} expression The value to compare.
* @returns {!LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator. * @return {!LessThanOrEqualTo} `<PropertyIsLessThanOrEqualTo>` operator.
* @api * @api
*/ */
export function lessThanOrEqualTo(propertyName, expression) { export function lessThanOrEqualTo(propertyName, expression) {
@@ -204,7 +204,7 @@ export function lessThanOrEqualTo(propertyName, expression) {
* *
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare. * @param {!number} expression The value to compare.
* @returns {!GreaterThan} `<PropertyIsGreaterThan>` operator. * @return {!GreaterThan} `<PropertyIsGreaterThan>` operator.
* @api * @api
*/ */
export function greaterThan(propertyName, expression) { export function greaterThan(propertyName, expression) {
@@ -216,7 +216,7 @@ export function greaterThan(propertyName, expression) {
* *
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @param {!number} expression The value to compare. * @param {!number} expression The value to compare.
* @returns {!GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator. * @return {!GreaterThanOrEqualTo} `<PropertyIsGreaterThanOrEqualTo>` operator.
* @api * @api
*/ */
export function greaterThanOrEqualTo(propertyName, expression) { export function greaterThanOrEqualTo(propertyName, expression) {
@@ -228,7 +228,7 @@ export function greaterThanOrEqualTo(propertyName, expression) {
* is null. * is null.
* *
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @returns {!IsNull} `<PropertyIsNull>` operator. * @return {!IsNull} `<PropertyIsNull>` operator.
* @api * @api
*/ */
export function isNull(propertyName) { export function isNull(propertyName) {
@@ -242,7 +242,7 @@ export function isNull(propertyName) {
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @param {!number} lowerBoundary The lower bound of the range. * @param {!number} lowerBoundary The lower bound of the range.
* @param {!number} upperBoundary The upper bound of the range. * @param {!number} upperBoundary The upper bound of the range.
* @returns {!IsBetween} `<PropertyIsBetween>` operator. * @return {!IsBetween} `<PropertyIsBetween>` operator.
* @api * @api
*/ */
export function between(propertyName, lowerBoundary, upperBoundary) { export function between(propertyName, lowerBoundary, upperBoundary) {
@@ -262,7 +262,7 @@ export function between(propertyName, lowerBoundary, upperBoundary) {
* @param {string=} opt_escapeChar Escape character which can be used to escape * @param {string=} opt_escapeChar Escape character which can be used to escape
* the pattern characters. Default is '!'. * the pattern characters. Default is '!'.
* @param {boolean=} opt_matchCase Case-sensitive? * @param {boolean=} opt_matchCase Case-sensitive?
* @returns {!IsLike} `<PropertyIsLike>` operator. * @return {!IsLike} `<PropertyIsLike>` operator.
* @api * @api
*/ */
export function like( export function like(
@@ -289,7 +289,7 @@ export function like(
* @param {!string} propertyName Name of the context property to compare. * @param {!string} propertyName Name of the context property to compare.
* @param {!string} begin The begin date in ISO-8601 format. * @param {!string} begin The begin date in ISO-8601 format.
* @param {!string} end The end date in ISO-8601 format. * @param {!string} end The end date in ISO-8601 format.
* @returns {!During} `<During>` operator. * @return {!During} `<During>` operator.
* @api * @api
*/ */
export function during(propertyName, begin, end) { export function during(propertyName, begin, end) {
+1 -1
View File
@@ -23,7 +23,7 @@ class Filter {
/** /**
* The XML tag name for a filter. * The XML tag name for a filter.
* @returns {!string} Name. * @return {!string} Name.
*/ */
getTagName() { getTagName() {
return this.tagName_; return this.tagName_;
+2 -2
View File
@@ -6,7 +6,7 @@ import {equals as arrayEquals} from './array.js';
/** /**
* Always returns true. * Always returns true.
* @returns {boolean} true. * @return {boolean} true.
*/ */
export function TRUE() { export function TRUE() {
return true; return true;
@@ -14,7 +14,7 @@ export function TRUE() {
/** /**
* Always returns false. * Always returns false.
* @returns {boolean} false. * @return {boolean} false.
*/ */
export function FALSE() { export function FALSE() {
return false; return false;
+6 -6
View File
@@ -188,7 +188,7 @@ class Extent extends PointerInteraction {
/** /**
* @param {import("../pixel.js").Pixel} pixel cursor location * @param {import("../pixel.js").Pixel} pixel cursor location
* @param {import("../PluggableMap.js").default} map map * @param {import("../PluggableMap.js").default} map map
* @returns {import("../coordinate.js").Coordinate|null} snapped vertex on extent * @return {import("../coordinate.js").Coordinate|null} snapped vertex on extent
* @private * @private
*/ */
snapToVertex_(pixel, map) { snapToVertex_(pixel, map) {
@@ -245,7 +245,7 @@ class Extent extends PointerInteraction {
/** /**
* @param {import("../extent.js").Extent} extent extent * @param {import("../extent.js").Extent} extent extent
* @returns {Feature} extent as featrue * @return {Feature} extent as featrue
* @private * @private
*/ */
createOrUpdateExtentFeature_(extent) { createOrUpdateExtentFeature_(extent) {
@@ -271,7 +271,7 @@ class Extent extends PointerInteraction {
/** /**
* @param {import("../coordinate.js").Coordinate} vertex location of feature * @param {import("../coordinate.js").Coordinate} vertex location of feature
* @returns {Feature} vertex as feature * @return {Feature} vertex as feature
* @private * @private
*/ */
createOrUpdatePointerFeature_(vertex) { createOrUpdatePointerFeature_(vertex) {
@@ -471,7 +471,7 @@ function getDefaultPointerStyleFunction() {
/** /**
* @param {import("../coordinate.js").Coordinate} fixedPoint corner that will be unchanged in the new extent * @param {import("../coordinate.js").Coordinate} fixedPoint corner that will be unchanged in the new extent
* @returns {function (import("../coordinate.js").Coordinate): import("../extent.js").Extent} event handler * @return {function (import("../coordinate.js").Coordinate): import("../extent.js").Extent} event handler
*/ */
function getPointHandler(fixedPoint) { function getPointHandler(fixedPoint) {
return function (point) { return function (point) {
@@ -482,7 +482,7 @@ function getPointHandler(fixedPoint) {
/** /**
* @param {import("../coordinate.js").Coordinate} fixedP1 first corner that will be unchanged in the new extent * @param {import("../coordinate.js").Coordinate} fixedP1 first corner that will be unchanged in the new extent
* @param {import("../coordinate.js").Coordinate} fixedP2 second corner that will be unchanged in the new extent * @param {import("../coordinate.js").Coordinate} fixedP2 second corner that will be unchanged in the new extent
* @returns {function (import("../coordinate.js").Coordinate): import("../extent.js").Extent|null} event handler * @return {function (import("../coordinate.js").Coordinate): import("../extent.js").Extent|null} event handler
*/ */
function getEdgeHandler(fixedP1, fixedP2) { function getEdgeHandler(fixedP1, fixedP2) {
if (fixedP1[0] == fixedP2[0]) { if (fixedP1[0] == fixedP2[0]) {
@@ -500,7 +500,7 @@ function getEdgeHandler(fixedP1, fixedP2) {
/** /**
* @param {import("../extent.js").Extent} extent extent * @param {import("../extent.js").Extent} extent extent
* @returns {Array<Array<import("../coordinate.js").Coordinate>>} extent line segments * @return {Array<Array<import("../coordinate.js").Coordinate>>} extent line segments
*/ */
function getSegments(extent) { function getSegments(extent) {
return [ return [
+1 -1
View File
@@ -277,7 +277,7 @@ class Select extends Interaction {
/** /**
* Returns the Hit-detection tolerance. * Returns the Hit-detection tolerance.
* @returns {number} Hit tolerance in pixels. * @return {number} Hit tolerance in pixels.
* @api * @api
*/ */
getHitTolerance() { getHitTolerance() {
+1 -1
View File
@@ -320,7 +320,7 @@ class Translate extends PointerInteraction {
/** /**
* Returns the Hit-detection tolerance. * Returns the Hit-detection tolerance.
* @returns {number} Hit tolerance in pixels. * @return {number} Hit tolerance in pixels.
* @api * @api
*/ */
getHitTolerance() { getHitTolerance() {
+5 -5
View File
@@ -560,7 +560,7 @@ export function clearUserProjection() {
* Get the projection for coordinates supplied from and returned by API methods. * Get the projection for coordinates supplied from and returned by API methods.
* Note that this method is not yet a part of the stable API. Support for user * Note that this method is not yet a part of the stable API. Support for user
* projections is not yet complete and should be considered experimental. * projections is not yet complete and should be considered experimental.
* @returns {?Projection} The user projection (or null if not set). * @return {?Projection} The user projection (or null if not set).
*/ */
export function getUserProjection() { export function getUserProjection() {
return userProjection; return userProjection;
@@ -580,7 +580,7 @@ export function useGeographic() {
* is set, the original coordinate is returned. * is set, the original coordinate is returned.
* @param {Array<number>} coordinate Input coordinate. * @param {Array<number>} coordinate Input coordinate.
* @param {ProjectionLike} sourceProjection The input coordinate projection. * @param {ProjectionLike} sourceProjection The input coordinate projection.
* @returns {Array<number>} The input coordinate in the user projection. * @return {Array<number>} The input coordinate in the user projection.
*/ */
export function toUserCoordinate(coordinate, sourceProjection) { export function toUserCoordinate(coordinate, sourceProjection) {
if (!userProjection) { if (!userProjection) {
@@ -594,7 +594,7 @@ export function toUserCoordinate(coordinate, sourceProjection) {
* is set, the original coordinate is returned. * is set, the original coordinate is returned.
* @param {Array<number>} coordinate Input coordinate. * @param {Array<number>} coordinate Input coordinate.
* @param {ProjectionLike} destProjection The destination projection. * @param {ProjectionLike} destProjection The destination projection.
* @returns {Array<number>} The input coordinate transformed. * @return {Array<number>} The input coordinate transformed.
*/ */
export function fromUserCoordinate(coordinate, destProjection) { export function fromUserCoordinate(coordinate, destProjection) {
if (!userProjection) { if (!userProjection) {
@@ -608,7 +608,7 @@ export function fromUserCoordinate(coordinate, destProjection) {
* is set, the original extent is returned. * is set, the original extent is returned.
* @param {import("./extent.js").Extent} extent Input extent. * @param {import("./extent.js").Extent} extent Input extent.
* @param {ProjectionLike} sourceProjection The input extent projection. * @param {ProjectionLike} sourceProjection The input extent projection.
* @returns {import("./extent.js").Extent} The input extent in the user projection. * @return {import("./extent.js").Extent} The input extent in the user projection.
*/ */
export function toUserExtent(extent, sourceProjection) { export function toUserExtent(extent, sourceProjection) {
if (!userProjection) { if (!userProjection) {
@@ -622,7 +622,7 @@ export function toUserExtent(extent, sourceProjection) {
* is set, the original extent is returned. * is set, the original extent is returned.
* @param {import("./extent.js").Extent} extent Input extent. * @param {import("./extent.js").Extent} extent Input extent.
* @param {ProjectionLike} destProjection The destination projection. * @param {ProjectionLike} destProjection The destination projection.
* @returns {import("./extent.js").Extent} The input extent transformed. * @return {import("./extent.js").Extent} The input extent transformed.
*/ */
export function fromUserExtent(extent, destProjection) { export function fromUserExtent(extent, destProjection) {
if (!userProjection) { if (!userProjection) {
+2 -2
View File
@@ -84,7 +84,7 @@ export function toContext(context, opt_options) {
/** /**
* Gets a vector context for drawing to the event's canvas. * Gets a vector context for drawing to the event's canvas.
* @param {import("./render/Event.js").default} event Render event. * @param {import("./render/Event.js").default} event Render event.
* @returns {CanvasImmediateRenderer} Vector context. * @return {CanvasImmediateRenderer} Vector context.
* @api * @api
*/ */
export function getVectorContext(event) { export function getVectorContext(event) {
@@ -121,7 +121,7 @@ export function getVectorContext(event) {
* @param {import("./render/Event.js").default} event Render event. * @param {import("./render/Event.js").default} event Render event.
* @param {import("./pixel.js").Pixel} pixel CSS pixel relative to the top-left * @param {import("./pixel.js").Pixel} pixel CSS pixel relative to the top-left
* corner of the map viewport. * corner of the map viewport.
* @returns {import("./pixel.js").Pixel} Pixel on the event's canvas context. * @return {import("./pixel.js").Pixel} Pixel on the event's canvas context.
* @api * @api
*/ */
export function getRenderPixel(event, pixel) { export function getRenderPixel(event, pixel) {
+1 -1
View File
@@ -352,7 +352,7 @@ export function measureTextWidth(font, text) {
* @param {string} font The font. * @param {string} font The font.
* @param {string} text The text to measure. * @param {string} text The text to measure.
* @param {Object<string, number>} cache A lookup of cached widths by text. * @param {Object<string, number>} cache A lookup of cached widths by text.
* @returns {number} The text width. * @return {number} The text width.
*/ */
export function measureAndCacheTextWidth(font, text, cache) { export function measureAndCacheTextWidth(font, text, cache) {
if (text in cache) { if (text in cache) {
+1 -1
View File
@@ -379,7 +379,7 @@ const circlePixelIndexArrayCache = {};
* ordered by how close they are to the center. * ordered by how close they are to the center.
* A cache is used to increase performance. * A cache is used to increase performance.
* @param {number} radius Radius. * @param {number} radius Radius.
* @returns {Array<number>} An array with indexes within a circle. * @return {Array<number>} An array with indexes within a circle.
*/ */
export function getPixelIndexArray(radius) { export function getPixelIndexArray(radius) {
if (circlePixelIndexArrayCache[radius] !== undefined) { if (circlePixelIndexArrayCache[radius] !== undefined) {
+2 -2
View File
@@ -6,7 +6,7 @@
* @param {number} number Number to be formatted * @param {number} number Number to be formatted
* @param {number} width The desired width * @param {number} width The desired width
* @param {number=} opt_precision Precision of the output string (i.e. number of decimal places) * @param {number=} opt_precision Precision of the output string (i.e. number of decimal places)
* @returns {string} Formatted string * @return {string} Formatted string
*/ */
export function padNumber(number, width, opt_precision) { export function padNumber(number, width, opt_precision) {
const numberString = const numberString =
@@ -22,7 +22,7 @@ export function padNumber(number, width, opt_precision) {
* Adapted from https://github.com/omichelsen/compare-versions/blob/master/index.js * Adapted from https://github.com/omichelsen/compare-versions/blob/master/index.js
* @param {string|number} v1 First version * @param {string|number} v1 First version
* @param {string|number} v2 Second version * @param {string|number} v2 Second version
* @returns {number} Value * @return {number} Value
*/ */
export function compareVersions(v1, v2) { export function compareVersions(v1, v2) {
const s1 = ('' + v1).split('.'); const s1 = ('' + v1).split('.');
+2 -2
View File
@@ -160,10 +160,10 @@ class ImageStyle {
return abstract(); return abstract();
} }
/* /**
* Get the image pixel ratio. * Get the image pixel ratio.
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* */ */
getPixelRatio(pixelRatio) { getPixelRatio(pixelRatio) {
return 1; return 1;
} }
+3 -3
View File
@@ -240,10 +240,10 @@ class RegularShape extends ImageStyle {
return this.canvas_[pixelRatio || 1]; return this.canvas_[pixelRatio || 1];
} }
/* /**
* Get the image pixel ratio. * Get the image pixel ratio.
* @param {number} pixelRatio Pixel ratio. * @param {number} pixelRatio Pixel ratio.
* */ */
getPixelRatio(pixelRatio) { getPixelRatio(pixelRatio) {
return pixelRatio; return pixelRatio;
} }
@@ -339,7 +339,7 @@ class RegularShape extends ImageStyle {
unlistenImageChange(listener) {} unlistenImageChange(listener) {}
/** /**
* @returns {RenderOptions} The render options * @return {RenderOptions} The render options
* @protected * @protected
*/ */
createRenderOptions() { createRenderOptions() {
+7 -7
View File
@@ -110,7 +110,7 @@ export const Operators = {};
* Returns the possible types for a given value (each type being a binary flag) * Returns the possible types for a given value (each type being a binary flag)
* To test a value use e.g. `getValueType(v) & ValueTypes.BOOLEAN` * To test a value use e.g. `getValueType(v) & ValueTypes.BOOLEAN`
* @param {ExpressionValue} value Value * @param {ExpressionValue} value Value
* @returns {ValueTypes|number} Type or types inferred from the value * @return {ValueTypes|number} Type or types inferred from the value
*/ */
export function getValueType(value) { export function getValueType(value) {
if (typeof value === 'number') { if (typeof value === 'number') {
@@ -175,7 +175,7 @@ export function isTypeUnique(valueType) {
/** /**
* Will return the number as a float with a dot separator, which is required by GLSL. * Will return the number as a float with a dot separator, which is required by GLSL.
* @param {number} v Numerical value. * @param {number} v Numerical value.
* @returns {string} The value as string. * @return {string} The value as string.
*/ */
export function numberToGlsl(v) { export function numberToGlsl(v) {
const s = v.toString(); const s = v.toString();
@@ -185,7 +185,7 @@ export function numberToGlsl(v) {
/** /**
* Will return the number array as a float with a dot separator, concatenated with ', '. * Will return the number array as a float with a dot separator, concatenated with ', '.
* @param {Array<number>} array Numerical values array. * @param {Array<number>} array Numerical values array.
* @returns {string} The array as a vector, e. g.: `vec3(1.0, 2.0, 3.0)`. * @return {string} The array as a vector, e. g.: `vec3(1.0, 2.0, 3.0)`.
*/ */
export function arrayToGlsl(array) { export function arrayToGlsl(array) {
if (array.length < 2 || array.length > 4) { if (array.length < 2 || array.length > 4) {
@@ -201,7 +201,7 @@ export function arrayToGlsl(array) {
* @param {string|import("../color.js").Color} color Color either in string format or [r, g, b, a] array format, * @param {string|import("../color.js").Color} color Color either in string format or [r, g, b, a] array format,
* with RGB components in the 0..255 range and the alpha component in the 0..1 range. * with RGB components in the 0..255 range and the alpha component in the 0..1 range.
* Note that the final array will always have 4 components. * Note that the final array will always have 4 components.
* @returns {string} The color expressed in the `vec4(1.0, 1.0, 1.0, 1.0)` form. * @return {string} The color expressed in the `vec4(1.0, 1.0, 1.0, 1.0)` form.
*/ */
export function colorToGlsl(color) { export function colorToGlsl(color) {
const array = asArray(color).slice(); const array = asArray(color).slice();
@@ -219,7 +219,7 @@ export function colorToGlsl(color) {
* Returns a stable equivalent number for the string literal. * Returns a stable equivalent number for the string literal.
* @param {ParsingContext} context Parsing context * @param {ParsingContext} context Parsing context
* @param {string} string String literal value * @param {string} string String literal value
* @returns {number} Number equivalent * @return {number} Number equivalent
*/ */
export function getStringNumberEquivalent(context, string) { export function getStringNumberEquivalent(context, string) {
if (context.stringLiteralsMap[string] === undefined) { if (context.stringLiteralsMap[string] === undefined) {
@@ -235,7 +235,7 @@ export function getStringNumberEquivalent(context, string) {
* converted to be a GLSL-compatible string. * converted to be a GLSL-compatible string.
* @param {ParsingContext} context Parsing context * @param {ParsingContext} context Parsing context
* @param {string} string String literal value * @param {string} string String literal value
* @returns {string} GLSL-compatible string containing a number * @return {string} GLSL-compatible string containing a number
*/ */
export function stringToGlsl(context, string) { export function stringToGlsl(context, string) {
return numberToGlsl(getStringNumberEquivalent(context, string)); return numberToGlsl(getStringNumberEquivalent(context, string));
@@ -247,7 +247,7 @@ export function stringToGlsl(context, string) {
* @param {ParsingContext} context Parsing context * @param {ParsingContext} context Parsing context
* @param {ExpressionValue} value Value * @param {ExpressionValue} value Value
* @param {ValueTypes|number} [typeHint] Hint for the expected final type (can be several types combined) * @param {ValueTypes|number} [typeHint] Hint for the expected final type (can be several types combined)
* @returns {string} GLSL-compatible output * @return {string} GLSL-compatible output
*/ */
export function expressionToGlsl(context, value, typeHint) { export function expressionToGlsl(context, value, typeHint) {
// operator // operator
+1 -1
View File
@@ -119,7 +119,7 @@ class WebGLArrayBuffer {
/** /**
* Returns a typed array constructor based on the given buffer type * Returns a typed array constructor based on the given buffer type
* @param {number} type Buffer type, either ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER. * @param {number} type Buffer type, either ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
* @returns {Float32ArrayConstructor|Uint32ArrayConstructor} The typed array class to use for this buffer. * @return {Float32ArrayConstructor|Uint32ArrayConstructor} The typed array class to use for this buffer.
*/ */
export function getArrayClassForType(type) { export function getArrayClassForType(type) {
switch (type) { switch (type) {
+2 -2
View File
@@ -963,7 +963,7 @@ class WebGLHelper extends Disposable {
/** /**
* Compute a stride in bytes based on a list of attributes * Compute a stride in bytes based on a list of attributes
* @param {Array<AttributeDescription>} attributes Ordered list of attributes * @param {Array<AttributeDescription>} attributes Ordered list of attributes
* @returns {number} Stride, ie amount of values for each vertex in the vertex buffer * @return {number} Stride, ie amount of values for each vertex in the vertex buffer
* @api * @api
*/ */
export function computeAttributesStride(attributes) { export function computeAttributesStride(attributes) {
@@ -978,7 +978,7 @@ export function computeAttributesStride(attributes) {
/** /**
* Computes the size in byte of an attribute type. * Computes the size in byte of an attribute type.
* @param {AttributeType} type Attribute type * @param {AttributeType} type Attribute type
* @returns {number} The size in bytes * @return {number} The size in bytes
*/ */
function getByteSizeFromType(type) { function getByteSizeFromType(type) {
switch (type) { switch (type) {
+1 -1
View File
@@ -285,7 +285,7 @@ class WebGLPostProcessingPass {
} }
/** /**
* @returns {WebGLFramebuffer} Frame buffer * @return {WebGLFramebuffer} Frame buffer
* @api * @api
*/ */
getFrameBuffer() { getFrameBuffer() {
+1 -1
View File
@@ -125,7 +125,7 @@ class WebGLRenderTarget {
* If x and/or y are outside of existing data, an array filled with 0 is returned. * If x and/or y are outside of existing data, an array filled with 0 is returned.
* @param {number} x Pixel coordinate * @param {number} x Pixel coordinate
* @param {number} y Pixel coordinate * @param {number} y Pixel coordinate
* @returns {Uint8Array} Integer array with one color value (4 components) * @return {Uint8Array} Integer array with one color value (4 components)
* @api * @api
*/ */
readPixel(x, y) { readPixel(x, y) {
+8 -8
View File
@@ -223,35 +223,35 @@ export class ShaderBuilder {
} }
/** /**
* @returns {string} Previously set size expression * @return {string} Previously set size expression
*/ */
getSizeExpression() { getSizeExpression() {
return this.sizeExpression; return this.sizeExpression;
} }
/** /**
* @returns {string} Previously set symbol offset expression * @return {string} Previously set symbol offset expression
*/ */
getOffsetExpression() { getOffsetExpression() {
return this.offsetExpression; return this.offsetExpression;
} }
/** /**
* @returns {string} Previously set color expression * @return {string} Previously set color expression
*/ */
getColorExpression() { getColorExpression() {
return this.colorExpression; return this.colorExpression;
} }
/** /**
* @returns {string} Previously set texture coordinate expression * @return {string} Previously set texture coordinate expression
*/ */
getTextureCoordinateExpression() { getTextureCoordinateExpression() {
return this.texCoordExpression; return this.texCoordExpression;
} }
/** /**
* @returns {string} Previously set fragment discard expression * @return {string} Previously set fragment discard expression
*/ */
getFragmentDiscardExpression() { getFragmentDiscardExpression() {
return this.discardExpression; return this.discardExpression;
@@ -272,7 +272,7 @@ export class ShaderBuilder {
* *
* @param {boolean} [forHitDetection] If true, the shader will be modified to include hit detection variables * @param {boolean} [forHitDetection] If true, the shader will be modified to include hit detection variables
* (namely, hit color with encoded feature id). * (namely, hit color with encoded feature id).
* @returns {string} The full shader as a string. * @return {string} The full shader as a string.
*/ */
getSymbolVertexShader(forHitDetection) { getSymbolVertexShader(forHitDetection) {
const offsetMatrix = this.rotateWithView const offsetMatrix = this.rotateWithView
@@ -363,7 +363,7 @@ ${varyings
* *
* @param {boolean} [forHitDetection] If true, the shader will be modified to include hit detection variables * @param {boolean} [forHitDetection] If true, the shader will be modified to include hit detection variables
* (namely, hit color with encoded feature id). * (namely, hit color with encoded feature id).
* @returns {string} The full shader as a string. * @return {string} The full shader as a string.
*/ */
getSymbolFragmentShader(forHitDetection) { getSymbolFragmentShader(forHitDetection) {
const hitDetectionBypass = forHitDetection const hitDetectionBypass = forHitDetection
@@ -421,7 +421,7 @@ ${hitDetectionBypass}
* {@link module:ol/renderer/webgl/PointsLayer~WebGLPointsLayerRenderer}. * {@link module:ol/renderer/webgl/PointsLayer~WebGLPointsLayerRenderer}.
* *
* @param {import("../style/LiteralStyle").LiteralStyle} style Literal style. * @param {import("../style/LiteralStyle").LiteralStyle} style Literal style.
* @returns {StyleParseResult} Result containing shader params, attributes and uniforms. * @return {StyleParseResult} Result containing shader params, attributes and uniforms.
*/ */
export function parseLiteralStyle(style) { export function parseLiteralStyle(style) {
const symbStyle = style.symbol; const symbStyle = style.symbol;