The decision which icon to use will be made by the calculator
-function of the MarkerClusterer.
You may use a custom calculator-function (may be added via the setCalculator-method.)
The default-calculator:
function(markers, numStyles) {
var index = 0;
var count = markers.length;
var dv = count;
while (dv !== 0) {
dv = parseInt(dv / 10, 10);
index++;
}
index = Math.min(index, numStyles);
return {
text: count,
index: index
};
};
As you see, there will be passed 2 arguments:
markers
: the markers for the cluster
numStyles
: the number of styles available for the MarkerClusterer-instance(by default 5).
The calculator must return an object with the properties:
- text(text to display, usually the number of markers in the cluster)
- index(the index of the style that has to be applied)
So what you have to do is:
- setup your custom styles(icons)
- apply your custom calculator-function that returns the desired index