jbdemonte/gmap3 — pull request #32 by khustochka (2012-05-08 11:42:18+00:00)
Title: Allow showing clusters having 1 marker

I agree that my pull request may be not the best solution (changing behaviour people are used to already), but I would like to inspire some discussion on the topic:

**Problem:** I believe that many people who are using clustering feature would like the same style for showing clusters both with many and with one marker. But for now cluster with 1 marker is always rendered as marker.

Additionally the comment in the demo is misleading:

clusters:{
// This style will be used for clusters with more than 0 markers
0: {
content: '

CLUSTER_COUNT

',
width: 53,
height: 52
},...

While actually, this style will be used only for clusters with more than 1 marker!

**My proposal:** Just allow having clusters with 1 marker (remove check for `cluster.idx.length > 1`).

Those who would still like to have single markers are free to use clusters options index 2:

clusters:{
// This style will be used for clusters with 2 or more markers
2: { ....

**P.S.** I also made a minor change to demo page, it was saying `This style will be used for clusters with more than 20` while I see from code it is actually for 20 and more (`k <= cluster.idx.length`).