If a GeoJSON FeatureCollection contains a Feature with a geometry of type: 'GeometryCollection', adding that FeatureCollection to a cluster data source currently seems to cause an error. I understand that this might simply not be a supported use case (given that clustering really only works with point features). But just want to report this, in case anyone has thoughts.
Link to Demonstration
Here's a minimal CodeSandbox, which adds the following FeatureCollection to a cluster layer:
Ideally, GeometryCollections with multiple points would end up in multiple clusters. If not possible, a more descriptive error message would be great to make spotting the problem easier.
Actual Behavior
When adding the FeatureCollection, the cluster layer breaks during rendering. The console prints an error:
maplibre-gl.js?v=6005537a:397
Error {message: 'undefined is not iterable (cannot read property Symbol(Symbol.iterator))'}
message: "undefined is not iterable (cannot read property Symbol(Symbol.iterator))"
maplibre-gl-js version: 3.6.2
browser: Chrome
If a GeoJSON FeatureCollection contains a Feature with a
geometry
oftype: 'GeometryCollection'
, adding that FeatureCollection to a cluster data source currently seems to cause an error. I understand that this might simply not be a supported use case (given that clustering really only works with point features). But just want to report this, in case anyone has thoughts.Link to Demonstration
Here's a minimal CodeSandbox, which adds the following FeatureCollection to a cluster layer:
CodeSandbox: https://codesandbox.io/p/sandbox/busy-cache-r8r5k9
Expected Behavior
Ideally, GeometryCollections with multiple points would end up in multiple clusters. If not possible, a more descriptive error message would be great to make spotting the problem easier.
Actual Behavior
When adding the FeatureCollection, the cluster layer breaks during rendering. The console prints an error: