From 9f8f7afaaa2b730a47eae79c9564e2efe5a005c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sun, 14 Nov 2021 04:17:10 +0100 Subject: [PATCH] Fix `ol/source/Cluster#setSource` type annotation --- src/ol/source/Cluster.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ol/source/Cluster.js b/src/ol/source/Cluster.js index 5621a33d7f..652be06d72 100644 --- a/src/ol/source/Cluster.js +++ b/src/ol/source/Cluster.js @@ -52,7 +52,7 @@ import {getUid} from '../util.js'; * }); * } * ``` - * @property {VectorSource} [source] Source. + * @property {VectorSource} [source=null] Source. * @property {boolean} [wrapX=true] Whether to wrap the world horizontally. */ @@ -127,11 +127,14 @@ class Cluster extends VectorSource { this.createCustomCluster_ = options.createCluster; /** - * @type {VectorSource} + * @type {VectorSource|null} * @protected */ this.source = null; + /** + * @private + */ this.boundRefresh_ = this.refresh.bind(this); this.updateDistance(this.distance, this.minDistance); @@ -159,7 +162,7 @@ class Cluster extends VectorSource { /** * Get a reference to the wrapped source. - * @return {VectorSource} Source. + * @return {VectorSource|null} Source. * @api */ getSource() { @@ -209,7 +212,7 @@ class Cluster extends VectorSource { /** * Replace the wrapped source. - * @param {VectorSource} source The new source for this instance. + * @param {VectorSource|null} source The new source for this instance. * @api */ setSource(source) {