Defaults for the Layer, Source and Feature generics

This commit is contained in:
Andreas Hocevar
2022-01-26 19:07:47 +01:00
parent 2e5c1f2af9
commit 94cc414ea2
9 changed files with 26 additions and 19 deletions

View File

@@ -115,7 +115,7 @@ class Cluster extends VectorSource {
this.geometryFunction =
options.geometryFunction ||
function (feature) {
const geometry = feature.getGeometry();
const geometry = /** @type {Point} */ (feature.getGeometry());
assert(geometry.getType() == GeometryType.POINT, 10); // The default `geometryFunction` can only handle `Point` geometries
return geometry;
};