Adrian Latorre
Adrian Latorre

Reputation: 161

Creating Google Maps Clusters by type

I would like to know if it is possible to cluster markets on Google Maps not only by density or number, but also by type.

For example: I have 20 markers of type A and 50 of type B. Could I have a two different clusters, one grouping all the type A markers and another one with type B markers. Obviously with different icons.

Another possible solution would be a single cluster that its icon would change depending of the number of markers of type.

For example: if we have 20 markers type A and 50 type B, the cluster would be a B-Type image.

Any of this options can be possible? Thanks a lot.

Upvotes: 1

Views: 3438

Answers (2)

ramya
ramya

Reputation: 2770

hope this may help you-

Google Maps Server-side Clustering with Asp.net

Upvotes: 0

Sean Mickey
Sean Mickey

Reputation: 7716

Yes, you can have a different MarkerClusterer for different types of markers. My map has seven different MarkerClusterer instances (I actually use: MarkerClustererPlus) managing different marker types, with different icons as you describe.

You could achieve your second option, but it would be some messy code with constant checking, re-checking, and setting of MarkerClusterer options. I strongly recommend the first option.

Upvotes: 1

Related Questions