From 636862ab99acd2c324602428ae498ea19043c16e Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 29 Aug 2017 18:47:43 +0300 Subject: [PATCH] simplify getClusterExpansionZoom too --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 144ebcc..9c1c693 100644 --- a/index.js +++ b/index.js @@ -149,9 +149,10 @@ SuperCluster.prototype = { return tile.features.length ? tile : null; }, - getClusterExpansionZoom: function (clusterId, clusterZoom) { + getClusterExpansionZoom: function (clusterId) { + var clusterZoom = (clusterId % 32) - 1; while (clusterZoom < this.options.maxZoom) { - var children = this.getChildren(clusterId, clusterZoom); + var children = this.getChildren(clusterId); clusterZoom++; if (children.length !== 1) break; clusterId = children[0].properties.cluster_id;