Skip to content

Commit c2b5a99

Browse files
committed
fix(supercluster): fixes inconsistent rounding causing clusters to not decluster at maxZoom when using fractional zooming
1 parent c5cdf54 commit c2b5a99

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/algorithms/supercluster.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class SuperClusterAlgorithm extends AbstractAlgorithm {
5050

5151
public calculate(input: AlgorithmInput): AlgorithmOutput {
5252
let changed = false;
53-
const state = { zoom: input.map.getZoom() };
53+
const state = { zoom: Math.round(input.map.getZoom()) };
5454

5555
if (!equal(input.markers, this.markers)) {
5656
changed = true;
@@ -91,7 +91,7 @@ export class SuperClusterAlgorithm extends AbstractAlgorithm {
9191
return this.superCluster
9292
.getClusters([-180, -90, 180, 90], Math.round(map.getZoom()))
9393
.map((feature: ClusterFeature<{ marker: Marker }>) =>
94-
this.transformCluster(feature)
94+
this.transformCluster(feature),
9595
);
9696
}
9797

0 commit comments

Comments
 (0)