Use union instead of enum for geometry type
This commit is contained in:
committed by
Andreas Hocevar
parent
04ad0e0c5a
commit
9a6f8493fb
@@ -4,7 +4,6 @@
|
||||
|
||||
import EventType from '../events/EventType.js';
|
||||
import Feature from '../Feature.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
import Point from '../geom/Point.js';
|
||||
import VectorSource from './Vector.js';
|
||||
import {add as addCoordinate, scale as scaleCoordinate} from '../coordinate.js';
|
||||
@@ -116,7 +115,7 @@ class Cluster extends VectorSource {
|
||||
options.geometryFunction ||
|
||||
function (feature) {
|
||||
const geometry = /** @type {Point} */ (feature.getGeometry());
|
||||
assert(geometry.getType() == GeometryType.POINT, 10); // The default `geometryFunction` can only handle `Point` geometries
|
||||
assert(geometry.getType() == 'Point', 10); // The default `geometryFunction` can only handle `Point` geometries
|
||||
return geometry;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user