Skip to content

Commit bc64e5a

Browse files
committed
[Feat] Support inverted zoom behavior in GridClusterer.java
1 parent 0df869e commit bc64e5a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/boombimapi/domain/place/cluster/impl/GridClusterer.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ public List<ClusterResult> cluster(
3434
final int baseCellPixel = properties.baseCellPixel();
3535
final double tileSize = properties.tileSize();
3636
final int maxZoomAtRefZ = properties.maxZoomAtRefZ();
37-
final int shift = Math.max(0, zoomLevel - maxZoomAtRefZ);
37+
int shift;
38+
39+
if (properties.invertedZoom()) {
40+
shift = Math.max(0, maxZoomAtRefZ - zoomLevel);
41+
} else {
42+
shift = Math.max(0, zoomLevel - maxZoomAtRefZ);
43+
}
44+
3845
final int cellSizePixel = baseCellPixel << shift;
3946

4047
log.info(">>> GridClusterer cellSizePixel: {}", cellSizePixel);

0 commit comments

Comments
 (0)