getClusterExpansionZoom method
Returns the zoom on which the cluster expands into several children (useful for "click to zoom" feature) given the cluster's clusterId.
Implementation
int getClusterExpansionZoom(int clusterId) {
int expansionZoom = (clusterId % 32) - 1;
while (expansionZoom < this.maxZoom) {
final children = this.children(clusterId);
expansionZoom++;
if (children == null || children.isEmpty) break;
if (children.indexWhere((element) => !element.isCluster!) != -1) break;
clusterId = children.first.clusterId!;
}
return expansionZoom;
}