From c0903e6fc165543f711e8f6a0c8c86a4d0307445 Mon Sep 17 00:00:00 2001 From: Kevin Schmidt Date: Wed, 3 Oct 2018 13:23:40 -0600 Subject: [PATCH] Cast overloaded ends property to fix type check errors --- src/ol/render/Feature.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/render/Feature.js b/src/ol/render/Feature.js index c7ae4b266e..4188605672 100644 --- a/src/ol/render/Feature.js +++ b/src/ol/render/Feature.js @@ -115,7 +115,7 @@ class RenderFeature { if (!this.flatInteriorPoints_) { const flatCenter = getCenter(this.getExtent()); this.flatInteriorPoints_ = getInteriorPointOfArray( - this.flatCoordinates_, 0, this.ends_, 2, flatCenter, 0); + this.flatCoordinates_, 0, /** @type {Array} */ (this.ends_), 2, flatCenter, 0); } return this.flatInteriorPoints_; } @@ -126,9 +126,9 @@ class RenderFeature { getFlatInteriorPoints() { if (!this.flatInteriorPoints_) { const flatCenters = linearRingssCenter( - this.flatCoordinates_, 0, this.ends_, 2); + this.flatCoordinates_, 0, /** @type {Array>} */ (this.ends_), 2); this.flatInteriorPoints_ = getInteriorPointsOfMultiArray( - this.flatCoordinates_, 0, this.ends_, 2, flatCenters); + this.flatCoordinates_, 0, /** @type {Array>} */ (this.ends_), 2, flatCenters); } return this.flatInteriorPoints_; } @@ -152,7 +152,7 @@ class RenderFeature { this.flatMidpoints_ = []; const flatCoordinates = this.flatCoordinates_; let offset = 0; - const ends = this.ends_; + const ends = /** @type {Array} */ (this.ends_); for (let i = 0, ii = ends.length; i < ii; ++i) { const end = ends[i]; const midpoint = interpolatePoint(