diff --git a/src/ol/render/canvas/Builder.js b/src/ol/render/canvas/Builder.js index 8a7cb3aaca..6734e40a41 100644 --- a/src/ol/render/canvas/Builder.js +++ b/src/ol/render/canvas/Builder.js @@ -206,7 +206,7 @@ class CanvasBuilder extends VectorContext { * @inheritDoc. */ drawCustom(geometry, feature, renderer) { - this.beginGeometry(geometry, feature); + this.beginGeometry(feature); const type = geometry.getType(); const stride = geometry.getStride(); const builderBegin = this.coordinates.length; @@ -248,15 +248,14 @@ class CanvasBuilder extends VectorContext { this.instructions.push([CanvasInstruction.CUSTOM, builderBegin, builderEnd, geometry, renderer]); } - this.endGeometry(geometry, feature); + this.endGeometry(feature); } /** * @protected - * @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry. * @param {import("../../Feature.js").FeatureLike} feature Feature. */ - beginGeometry(geometry, feature) { + beginGeometry(feature) { this.beginGeometryInstruction1_ = [CanvasInstruction.BEGIN_GEOMETRY, feature, 0]; this.instructions.push(this.beginGeometryInstruction1_); this.beginGeometryInstruction2_ = [CanvasInstruction.BEGIN_GEOMETRY, feature, 0]; @@ -435,10 +434,9 @@ class CanvasBuilder extends VectorContext { } /** - * @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry. * @param {import("../../Feature.js").FeatureLike} feature Feature. */ - endGeometry(geometry, feature) { + endGeometry(feature) { this.beginGeometryInstruction1_[2] = this.instructions.length; this.beginGeometryInstruction1_ = null; this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length; diff --git a/src/ol/render/canvas/ImageBuilder.js b/src/ol/render/canvas/ImageBuilder.js index 0be94cedcf..c29e4a1e3d 100644 --- a/src/ol/render/canvas/ImageBuilder.js +++ b/src/ol/render/canvas/ImageBuilder.js @@ -113,7 +113,7 @@ class CanvasImageBuilder extends CanvasBuilder { if (!this.image_) { return; } - this.beginGeometry(pointGeometry, feature); + this.beginGeometry(feature); const flatCoordinates = pointGeometry.getFlatCoordinates(); const stride = pointGeometry.getStride(); const myBegin = this.coordinates.length; @@ -132,7 +132,7 @@ class CanvasImageBuilder extends CanvasBuilder { this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.width_ ]); - this.endGeometry(pointGeometry, feature); + this.endGeometry(feature); } /** @@ -142,7 +142,7 @@ class CanvasImageBuilder extends CanvasBuilder { if (!this.image_) { return; } - this.beginGeometry(multiPointGeometry, feature); + this.beginGeometry(feature); const flatCoordinates = multiPointGeometry.getFlatCoordinates(); const stride = multiPointGeometry.getStride(); const myBegin = this.coordinates.length; @@ -162,7 +162,7 @@ class CanvasImageBuilder extends CanvasBuilder { this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.width_ ]); - this.endGeometry(multiPointGeometry, feature); + this.endGeometry(feature); } /** diff --git a/src/ol/render/canvas/LineStringBuilder.js b/src/ol/render/canvas/LineStringBuilder.js index 44afceb58b..06df9e23ac 100644 --- a/src/ol/render/canvas/LineStringBuilder.js +++ b/src/ol/render/canvas/LineStringBuilder.js @@ -44,7 +44,7 @@ class CanvasLineStringBuilder extends CanvasBuilder { return; } this.updateStrokeStyle(state, this.applyStroke); - this.beginGeometry(lineStringGeometry, feature); + this.beginGeometry(feature); this.hitDetectionInstructions.push([ CanvasInstruction.SET_STROKE_STYLE, state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin, @@ -54,7 +54,7 @@ class CanvasLineStringBuilder extends CanvasBuilder { const stride = lineStringGeometry.getStride(); this.drawFlatCoordinates_(flatCoordinates, 0, flatCoordinates.length, stride); this.hitDetectionInstructions.push(strokeInstruction); - this.endGeometry(lineStringGeometry, feature); + this.endGeometry(feature); } /** @@ -68,7 +68,7 @@ class CanvasLineStringBuilder extends CanvasBuilder { return; } this.updateStrokeStyle(state, this.applyStroke); - this.beginGeometry(multiLineStringGeometry, feature); + this.beginGeometry(feature); this.hitDetectionInstructions.push([ CanvasInstruction.SET_STROKE_STYLE, state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin, @@ -82,7 +82,7 @@ class CanvasLineStringBuilder extends CanvasBuilder { offset = this.drawFlatCoordinates_(flatCoordinates, offset, ends[i], stride); } this.hitDetectionInstructions.push(strokeInstruction); - this.endGeometry(multiLineStringGeometry, feature); + this.endGeometry(feature); } /** diff --git a/src/ol/render/canvas/PolygonBuilder.js b/src/ol/render/canvas/PolygonBuilder.js index 93678ddfb7..686ccb26bd 100644 --- a/src/ol/render/canvas/PolygonBuilder.js +++ b/src/ol/render/canvas/PolygonBuilder.js @@ -73,7 +73,7 @@ class CanvasPolygonBuilder extends CanvasBuilder { return; } this.setFillStrokeStyles_(circleGeometry); - this.beginGeometry(circleGeometry, feature); + this.beginGeometry(feature); if (state.fillStyle !== undefined) { this.hitDetectionInstructions.push([ CanvasInstruction.SET_FILL_STYLE, @@ -103,7 +103,7 @@ class CanvasPolygonBuilder extends CanvasBuilder { this.instructions.push(strokeInstruction); this.hitDetectionInstructions.push(strokeInstruction); } - this.endGeometry(circleGeometry, feature); + this.endGeometry(feature); } /** @@ -117,7 +117,7 @@ class CanvasPolygonBuilder extends CanvasBuilder { return; } this.setFillStrokeStyles_(polygonGeometry); - this.beginGeometry(polygonGeometry, feature); + this.beginGeometry(feature); if (state.fillStyle !== undefined) { this.hitDetectionInstructions.push([ CanvasInstruction.SET_FILL_STYLE, @@ -135,7 +135,7 @@ class CanvasPolygonBuilder extends CanvasBuilder { const flatCoordinates = polygonGeometry.getOrientedFlatCoordinates(); const stride = polygonGeometry.getStride(); this.drawFlatCoordinatess_(flatCoordinates, 0, ends, stride); - this.endGeometry(polygonGeometry, feature); + this.endGeometry(feature); } /** @@ -149,7 +149,7 @@ class CanvasPolygonBuilder extends CanvasBuilder { return; } this.setFillStrokeStyles_(multiPolygonGeometry); - this.beginGeometry(multiPolygonGeometry, feature); + this.beginGeometry(feature); if (state.fillStyle !== undefined) { this.hitDetectionInstructions.push([ CanvasInstruction.SET_FILL_STYLE, @@ -170,7 +170,7 @@ class CanvasPolygonBuilder extends CanvasBuilder { for (let i = 0, ii = endss.length; i < ii; ++i) { offset = this.drawFlatCoordinatess_(flatCoordinates, offset, endss[i], stride); } - this.endGeometry(multiPolygonGeometry, feature); + this.endGeometry(feature); } /** diff --git a/src/ol/render/canvas/TextBuilder.js b/src/ol/render/canvas/TextBuilder.js index e5850def1e..c3d446612a 100644 --- a/src/ol/render/canvas/TextBuilder.js +++ b/src/ol/render/canvas/TextBuilder.js @@ -184,7 +184,7 @@ class CanvasTextBuilder extends CanvasBuilder { ends.push(endss[i][0]); } } - this.beginGeometry(geometry, feature); + this.beginGeometry(feature); const textAlign = textState.textAlign; let flatOffset = 0; let flatEnd; @@ -204,7 +204,7 @@ class CanvasTextBuilder extends CanvasBuilder { this.drawChars_(begin, end, this.declutterGroup_); begin = end; } - this.endGeometry(geometry, feature); + this.endGeometry(feature); } else { @@ -267,7 +267,7 @@ class CanvasTextBuilder extends CanvasBuilder { } } - this.beginGeometry(geometry, feature); + this.beginGeometry(feature); // The image is unknown at this stage so we pass null; it will be computed at render time. // For clarity, we pass NaN for offsetX, offsetY, width and height, which will be computed at @@ -293,7 +293,7 @@ class CanvasTextBuilder extends CanvasBuilder { this.textOffsetX_, this.textOffsetY_, geometryWidths ]); - this.endGeometry(geometry, feature); + this.endGeometry(feature); } }