Merge pull request #12998 from MoonE/fix-cluster-setSource-type

Fix `ol/source/Cluster#setSource` type annotation
This commit is contained in:
MoonE
2022-02-11 22:38:47 +01:00
committed by GitHub

View File

@@ -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) {