This is not necessarily an issue with supercluster (assuming it expects all longitudes to be within the [-180, 180] range), but it causes issues with maplibre-gl and mapbox-gl.
For example, a point with coordinates [-181, 0] renders fine in a non-cluster mode in the two mentioned libraries, but it doesn't render in a clustered geojson source. Here's an example showing this issue: https://codepen.io/kaveh/pen/mdBqrYq. The red layer is for non-clustered points (shows 2 rendered points) and green is for clustered (shows only 1).
I could fix my coordinates before adding them to source in those libraries, but I thought if the same data works in non-clustered mode, it should work with clustered mode too and that's why I submitted the fix here.
This is not necessarily an issue with supercluster (assuming it expects all longitudes to be within the [-180, 180] range), but it causes issues with
maplibre-gl
andmapbox-gl
.For example, a point with coordinates [-181, 0] renders fine in a non-cluster mode in the two mentioned libraries, but it doesn't render in a clustered geojson source. Here's an example showing this issue: https://codepen.io/kaveh/pen/mdBqrYq. The red layer is for non-clustered points (shows 2 rendered points) and green is for clustered (shows only 1).
I could fix my coordinates before adding them to source in those libraries, but I thought if the same data works in non-clustered mode, it should work with clustered mode too and that's why I submitted the fix here.