Skip to content

Commit

Permalink
simplify getClusterExpansionZoom too
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Aug 29, 2017
1 parent e88603f commit 636862a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 636862a

Please sign in to comment.