From cebaa546b7d5c1f87cc786ece0b8776fc91caed6 Mon Sep 17 00:00:00 2001 From: Simon Seyock Date: Fri, 6 Aug 2021 10:05:19 +0200 Subject: [PATCH] Feature.clone returns correct type. --- src/ol/Feature.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ol/Feature.js b/src/ol/Feature.js index 834e618fa1..45769cc4e7 100644 --- a/src/ol/Feature.js +++ b/src/ol/Feature.js @@ -144,17 +144,17 @@ class Feature extends BaseObject { /** * Clone this feature. If the original feature has a geometry it * is also cloned. The feature id is not set in the clone. - * @return {Feature} The clone. + * @return {Feature} The clone. * @api */ clone() { - const clone = new Feature( - this.hasProperties() ? this.getProperties() : null + const clone = /** @type {Feature} */ ( + new Feature(this.hasProperties() ? this.getProperties() : null) ); clone.setGeometryName(this.getGeometryName()); const geometry = this.getGeometry(); if (geometry) { - clone.setGeometry(geometry.clone()); + clone.setGeometry(/** @type {Geometry} */ (geometry.clone())); } const style = this.getStyle(); if (style) {