Use Array<Foo> instead of Array.<Foo>
This commit is contained in:
@@ -31,13 +31,13 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<Array.<Array.<number>|number>>}
|
||||
* @type {Array<Array<Array<number>|number>>}
|
||||
*/
|
||||
this.styles_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.styleIndices_ = [];
|
||||
|
||||
@@ -49,9 +49,9 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {{fillColor: (Array.<number>|null),
|
||||
* strokeColor: (Array.<number>|null),
|
||||
* lineDash: Array.<number>,
|
||||
* @type {{fillColor: (Array<number>|null),
|
||||
* strokeColor: (Array<number>|null),
|
||||
* lineDash: Array<number>,
|
||||
* lineDashOffset: (number|undefined),
|
||||
* lineWidth: (number|undefined),
|
||||
* changed: boolean}|null}
|
||||
@@ -69,7 +69,7 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -136,8 +136,8 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
this.styles_.pop();
|
||||
if (this.styles_.length) {
|
||||
const lastState = this.styles_[this.styles_.length - 1];
|
||||
this.state_.fillColor = /** @type {Array.<number>} */ (lastState[0]);
|
||||
this.state_.strokeColor = /** @type {Array.<number>} */ (lastState[1]);
|
||||
this.state_.fillColor = /** @type {Array<number>} */ (lastState[0]);
|
||||
this.state_.strokeColor = /** @type {Array<number>} */ (lastState[1]);
|
||||
this.state_.lineWidth = /** @type {number} */ (lastState[2]);
|
||||
this.state_.changed = false;
|
||||
}
|
||||
@@ -242,8 +242,8 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
for (i = this.styleIndices_.length - 1; i >= 0; --i) {
|
||||
start = this.styleIndices_[i];
|
||||
nextStyle = this.styles_[i];
|
||||
this.setFillStyle_(gl, /** @type {Array.<number>} */ (nextStyle[0]));
|
||||
this.setStrokeStyle_(gl, /** @type {Array.<number>} */ (nextStyle[1]),
|
||||
this.setFillStyle_(gl, /** @type {Array<number>} */ (nextStyle[0]));
|
||||
this.setStrokeStyle_(gl, /** @type {Array<number>} */ (nextStyle[1]),
|
||||
/** @type {number} */ (nextStyle[2]));
|
||||
this.drawElements(gl, context, start, end);
|
||||
end = start;
|
||||
@@ -260,8 +260,8 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
end = this.startIndices[featureIndex + 1];
|
||||
for (i = this.styleIndices_.length - 1; i >= 0; --i) {
|
||||
nextStyle = this.styles_[i];
|
||||
this.setFillStyle_(gl, /** @type {Array.<number>} */ (nextStyle[0]));
|
||||
this.setStrokeStyle_(gl, /** @type {Array.<number>} */ (nextStyle[1]),
|
||||
this.setFillStyle_(gl, /** @type {Array<number>} */ (nextStyle[0]));
|
||||
this.setStrokeStyle_(gl, /** @type {Array<number>} */ (nextStyle[1]),
|
||||
/** @type {number} */ (nextStyle[2]));
|
||||
groupStart = this.styleIndices_[i];
|
||||
|
||||
@@ -305,8 +305,8 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
end = start = this.startIndices[featureIndex + 1];
|
||||
for (i = this.styleIndices_.length - 1; i >= 0; --i) {
|
||||
nextStyle = this.styles_[i];
|
||||
this.setFillStyle_(gl, /** @type {Array.<number>} */ (nextStyle[0]));
|
||||
this.setStrokeStyle_(gl, /** @type {Array.<number>} */ (nextStyle[1]),
|
||||
this.setFillStyle_(gl, /** @type {Array<number>} */ (nextStyle[0]));
|
||||
this.setStrokeStyle_(gl, /** @type {Array<number>} */ (nextStyle[1]),
|
||||
/** @type {number} */ (nextStyle[2]));
|
||||
groupStart = this.styleIndices_[i];
|
||||
|
||||
@@ -335,7 +335,7 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
/**
|
||||
* @private
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {Array.<number>} color Color.
|
||||
* @param {Array<number>} color Color.
|
||||
*/
|
||||
setFillStyle_(gl, color) {
|
||||
gl.uniform4fv(this.defaultLocations_.u_fillColor, color);
|
||||
@@ -344,7 +344,7 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
/**
|
||||
* @private
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {Array.<number>} color Color.
|
||||
* @param {Array<number>} color Color.
|
||||
* @param {number} lineWidth Line width.
|
||||
*/
|
||||
setStrokeStyle_(gl, color, lineWidth) {
|
||||
|
||||
@@ -14,25 +14,25 @@ class WebGLImageReplay extends WebGLTextureReplay {
|
||||
super(tolerance, maxExtent);
|
||||
|
||||
/**
|
||||
* @type {Array.<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>}
|
||||
* @type {Array<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>}
|
||||
* @protected
|
||||
*/
|
||||
this.images_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array.<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>}
|
||||
* @type {Array<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>}
|
||||
* @protected
|
||||
*/
|
||||
this.hitDetectionImages_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array.<WebGLTexture>}
|
||||
* @type {Array<WebGLTexture>}
|
||||
* @private
|
||||
*/
|
||||
this.textures_ = [];
|
||||
|
||||
/**
|
||||
* @type {Array.<WebGLTexture>}
|
||||
* @type {Array<WebGLTexture>}
|
||||
* @private
|
||||
*/
|
||||
this.hitDetectionTextures_ = [];
|
||||
|
||||
@@ -51,21 +51,21 @@ class WebGLLineStringReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<Array.<?>>}
|
||||
* @type {Array<Array<?>>}
|
||||
*/
|
||||
this.styles_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.styleIndices_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {{strokeColor: (Array.<number>|null),
|
||||
* @type {{strokeColor: (Array<number>|null),
|
||||
* lineCap: (string|undefined),
|
||||
* lineDash: Array.<number>,
|
||||
* lineDash: Array<number>,
|
||||
* lineDashOffset: (number|undefined),
|
||||
* lineJoin: (string|undefined),
|
||||
* lineWidth: (number|undefined),
|
||||
@@ -88,7 +88,7 @@ class WebGLLineStringReplay extends WebGLReplay {
|
||||
/**
|
||||
* Draw one segment.
|
||||
* @private
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -269,9 +269,9 @@ class WebGLLineStringReplay extends WebGLReplay {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} p0 Last coordinates.
|
||||
* @param {Array.<number>} p1 Current coordinates.
|
||||
* @param {Array.<number>} p2 Next coordinates.
|
||||
* @param {Array<number>} p0 Last coordinates.
|
||||
* @param {Array<number>} p1 Current coordinates.
|
||||
* @param {Array<number>} p2 Next coordinates.
|
||||
* @param {number} product Sign, instruction, and rounding product.
|
||||
* @param {number} numVertices Vertex counter.
|
||||
* @return {number} Vertex counter.
|
||||
@@ -291,7 +291,7 @@ class WebGLLineStringReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* Check if the linestring can be drawn (i. e. valid).
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -362,8 +362,8 @@ class WebGLLineStringReplay extends WebGLReplay {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array.<Array.<number>>} holeFlatCoordinates Hole flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<Array<number>>} holeFlatCoordinates Hole flat coordinates.
|
||||
* @param {number} stride Stride.
|
||||
*/
|
||||
drawPolygonCoordinates(flatCoordinates, holeFlatCoordinates, stride) {
|
||||
@@ -611,7 +611,7 @@ class WebGLLineStringReplay extends WebGLReplay {
|
||||
/**
|
||||
* @private
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {Array.<number>} color Color.
|
||||
* @param {Array<number>} color Color.
|
||||
* @param {number} lineWidth Line width.
|
||||
* @param {number} miterLimit Miter limit.
|
||||
*/
|
||||
|
||||
@@ -55,19 +55,19 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<Array.<number>>}
|
||||
* @type {Array<Array<number>>}
|
||||
*/
|
||||
this.styles_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.styleIndices_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {{fillColor: (Array.<number>|null),
|
||||
* @type {{fillColor: (Array<number>|null),
|
||||
* changed: boolean}|null}
|
||||
*/
|
||||
this.state_ = {
|
||||
@@ -79,8 +79,8 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* Draw one polygon.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array.<Array.<number>>} holeFlatCoordinates Hole flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<Array<number>>} holeFlatCoordinates Hole flat coordinates.
|
||||
* @param {number} stride Stride.
|
||||
* @private
|
||||
*/
|
||||
@@ -141,7 +141,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
/**
|
||||
* Inserts flat coordinates in a linked list and adds them to the vertex buffer.
|
||||
* @private
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/structs/LinkedList} list Linked list.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
@@ -195,7 +195,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
* Returns the rightmost coordinates of a polygon on the X axis.
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Polygons ring.
|
||||
* @return {Array.<number>} Max X coordinates.
|
||||
* @return {Array<number>} Max X coordinates.
|
||||
*/
|
||||
getMaxCoords_(list) {
|
||||
const start = list.firstItem();
|
||||
@@ -643,7 +643,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Third point.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {boolean=} opt_reflex Only include reflex points.
|
||||
* @return {Array.<module:ol/render/webgl/PolygonReplay~PolygonVertex>} Points in the triangle.
|
||||
* @return {Array<module:ol/render/webgl/PolygonReplay~PolygonVertex>} Points in the triangle.
|
||||
*/
|
||||
getPointsInTriangle_(p0, p1, p2, rtree, opt_reflex) {
|
||||
const result = [];
|
||||
@@ -670,7 +670,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonSegment} segment Segment.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {boolean=} opt_touch Touching segments should be considered an intersection.
|
||||
* @return {Array.<module:ol/render/webgl/PolygonReplay~PolygonSegment>} Intersecting segments.
|
||||
* @return {Array<module:ol/render/webgl/PolygonReplay~PolygonSegment>} Intersecting segments.
|
||||
*/
|
||||
getIntersections_(segment, rtree, opt_touch) {
|
||||
const p0 = segment.p0;
|
||||
@@ -698,7 +698,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Third point.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p3 Fourth point.
|
||||
* @param {boolean=} opt_touch Touching segments should be considered an intersection.
|
||||
* @return {Array.<number>|undefined} Intersection coordinates.
|
||||
* @return {Array<number>|undefined} Intersection coordinates.
|
||||
*/
|
||||
calculateIntersection_(p0, p1, p2, p3, opt_touch) {
|
||||
const denom = (p3.y - p2.y) * (p1.x - p0.x) - (p3.x - p2.x) * (p1.y - p0.y);
|
||||
@@ -1005,7 +1005,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
/**
|
||||
* @private
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {Array.<number>} color Color.
|
||||
* @param {Array<number>} color Color.
|
||||
*/
|
||||
setFillStyle_(gl, color) {
|
||||
gl.uniform4fv(this.defaultLocations_.u_color, color);
|
||||
|
||||
@@ -66,13 +66,13 @@ class WebGLReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.tmpMat4_ = create();
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.indices = [];
|
||||
|
||||
@@ -85,20 +85,20 @@ class WebGLReplay extends VectorContext {
|
||||
/**
|
||||
* Start index per feature (the index).
|
||||
* @protected
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.startIndices = [];
|
||||
|
||||
/**
|
||||
* Start index per feature (the feature).
|
||||
* @protected
|
||||
* @type {Array.<module:ol/Feature|module:ol/render/Feature>}
|
||||
* @type {Array<module:ol/Feature|module:ol/render/Feature>}
|
||||
*/
|
||||
this.startIndicesFeature = [];
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
this.vertices = [];
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import WebGLPolygonReplay from '../webgl/PolygonReplay.js';
|
||||
import WebGLTextReplay from '../webgl/TextReplay.js';
|
||||
|
||||
/**
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
*/
|
||||
const HIT_DETECTION_SIZE = [1, 1];
|
||||
|
||||
@@ -160,7 +160,7 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
opacity,
|
||||
skippedFeaturesHash
|
||||
) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const zs = Object.keys(this.replaysByZIndex_).map(Number);
|
||||
zs.sort(numberSafeCompareFunction);
|
||||
|
||||
@@ -209,7 +209,7 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
oneByOne,
|
||||
opt_hitExtent
|
||||
) {
|
||||
/** @type {Array.<number>} */
|
||||
/** @type {Array<number>} */
|
||||
const zs = Object.keys(this.replaysByZIndex_).map(Number);
|
||||
zs.sort(function(a, b) {
|
||||
return b - a;
|
||||
|
||||
@@ -32,13 +32,13 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<HTMLCanvasElement>}
|
||||
* @type {Array<HTMLCanvasElement>}
|
||||
*/
|
||||
this.images_ = [];
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<WebGLTexture>}
|
||||
* @type {Array<WebGLTexture>}
|
||||
*/
|
||||
this.textures_ = [];
|
||||
|
||||
@@ -52,7 +52,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
* @private
|
||||
* @type {{strokeColor: (module:ol/colorlike~ColorLike|null),
|
||||
* lineCap: (string|undefined),
|
||||
* lineDash: Array.<number>,
|
||||
* lineDash: Array<number>,
|
||||
* lineDashOffset: (number|undefined),
|
||||
* lineJoin: (string|undefined),
|
||||
* lineWidth: number,
|
||||
@@ -209,8 +209,8 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Array.<string>} lines Label to draw split to lines.
|
||||
* @return {Array.<number>} Size of the label in pixels.
|
||||
* @param {Array<string>} lines Label to draw split to lines.
|
||||
* @return {Array<number>} Size of the label in pixels.
|
||||
*/
|
||||
getTextSize_(lines) {
|
||||
const self = this;
|
||||
@@ -236,7 +236,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -427,7 +427,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {Array.<string|number>} params Array of parameters.
|
||||
* @param {Array<string|number>} params Array of parameters.
|
||||
* @return {string} Hash string.
|
||||
*/
|
||||
calculateHash_(params) {
|
||||
|
||||
@@ -31,13 +31,13 @@ class WebGLTextureReplay extends WebGLReplay {
|
||||
this.anchorY = undefined;
|
||||
|
||||
/**
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
* @protected
|
||||
*/
|
||||
this.groupIndices = [];
|
||||
|
||||
/**
|
||||
* @type {Array.<number>}
|
||||
* @type {Array<number>}
|
||||
* @protected
|
||||
*/
|
||||
this.hitDetectionGroupIndices = [];
|
||||
@@ -130,7 +130,7 @@ class WebGLTextureReplay extends WebGLReplay {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
@@ -233,8 +233,8 @@ class WebGLTextureReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @param {Array.<WebGLTexture>} textures Textures.
|
||||
* @param {Array.<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>} images Images.
|
||||
* @param {Array<WebGLTexture>} textures Textures.
|
||||
* @param {Array<HTMLCanvasElement|HTMLImageElement|HTMLVideoElement>} images Images.
|
||||
* @param {!Object.<string, WebGLTexture>} texturePerImage Texture cache.
|
||||
* @param {WebGLRenderingContext} gl Gl.
|
||||
*/
|
||||
@@ -353,8 +353,8 @@ class WebGLTextureReplay extends WebGLReplay {
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {Array.<WebGLTexture>} textures Textures.
|
||||
* @param {Array.<number>} groupIndices Texture group indices.
|
||||
* @param {Array<WebGLTexture>} textures Textures.
|
||||
* @param {Array<number>} groupIndices Texture group indices.
|
||||
*/
|
||||
drawReplaySkipping(gl, context, skippedFeaturesHash, textures, groupIndices) {
|
||||
let featureIndex = 0;
|
||||
@@ -462,14 +462,14 @@ class WebGLTextureReplay extends WebGLReplay {
|
||||
* @abstract
|
||||
* @protected
|
||||
* @param {boolean=} opt_all Return hit detection textures with regular ones.
|
||||
* @returns {Array.<WebGLTexture>} Textures.
|
||||
* @returns {Array<WebGLTexture>} Textures.
|
||||
*/
|
||||
getTextures(opt_all) {}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @protected
|
||||
* @returns {Array.<WebGLTexture>} Textures.
|
||||
* @returns {Array<WebGLTexture>} Textures.
|
||||
*/
|
||||
getHitDetectionTextures() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user