Shorter name for the option to create a custom cluster

This commit is contained in:
Tim Schaub
2021-07-15 21:35:59 -06:00
parent a617ef3caf
commit 1b9329ea91
2 changed files with 6 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ import {getUid} from '../util.js';
* ```
* See {@link module:ol/geom/Polygon~Polygon#getInteriorPoint} for a way to get a cluster
* calculation point for polygons.
* @property {function(Point, Array<Feature>):Feature} [createClusterFeature]
* @property {function(Point, Array<Feature>):Feature} [createCluster]
* Function that takes the cluster's center {@link module:ol/geom/Point} and an array
* of {@link module:ol/Feature} included in this cluster. Must return a
* {@link module:ol/Feature} that will be used to render. Default implementation is:
@@ -122,9 +122,9 @@ class Cluster extends VectorSource {
/**
* @type {function(Point, Array<Feature>):Feature}
* @protected
* @private
*/
this.createClusterFeature = options.createClusterFeature;
this.createCustomCluster_ = options.createCluster;
/**
* @type {VectorSource}
@@ -312,8 +312,8 @@ class Cluster extends VectorSource {
centroid[0] * (1 - ratio) + searchCenter[0] * ratio,
centroid[1] * (1 - ratio) + searchCenter[1] * ratio,
]);
if (this.createClusterFeature) {
return this.createClusterFeature(geometry, features);
if (this.createCustomCluster_) {
return this.createCustomCluster_(geometry, features);
} else {
return new Feature({
geometry,