Cluster minimumClusterSize can't be update dynamically
I have two clusters and I only want always two clusters on the map. so I want to make sure minimumClusterSize get increased after a new marker add to it. The minimumClusterSize should always equals the total markers in the cluster.
when I click on the map, I will add a new marker to the first cluster(the cluster starts with 5 markers) I realized that after I add a new marker, minimumClusterSize can't be updated. when you keep adding markers at some point, you will see more than two clusters. However, I only wants two clusters.
Here is the plnkr with the issue: http://plnkr.co/edit/TlkZ18IMbWKxI8pdgwko?p=preview
btw, it seems MarkerClusterer methods can't be accessed in the angular google maps? How do you call "setMinimumClusterSize()"?
dupe #1614 if you want it more angularly you might need to make a PR. Otherwise try typeOptions http://angular-ui.github.io/angular-google-maps/#!/api/markers
I am using typeOptions it doesn't work for this case
Your gonna need to dive into the source and make a PR, I do not have time to work on this.
We can update it dynamically by keeping a control on uiGmapMarkers directive and accessing that control in controller like this
'zoom_changed': function(map){
if (map.getZoom() >= 12) {
$timeout(function(){
vm.markerControl.getManager().clusterer.gridSize_ = 1;
vm.markerControl.getManager().clusterer.minClusterSize_ = 2;
});
} else {
$timeout(function(){
vm.markerControl.getManager().clusterer.gridSize_ = 50;
vm.markerControl.getManager().clusterer.minClusterSize_ = 50;
});
}
}
};