Search code examples
google-mapsgoogle-maps-api-3markerclusterer

MarkerClusterer and the default icons


I have a map with, say, 3 groups of markers (red, blue and green ones) that represent different kind of stores.

enter image description here

I need to group that multiple markers into a cluster, like MarkerClusterer does.

But for the moment I don't know if there is some ways to work with heterogeneous types of markers.

Let's say the simplest way is to group all markers regardless of its color when we unzoom. Is that possible to however to set a different color (red, blue and green specific) when the group is zoomed?


Solution

  • Let's say the simplest way is to group all markers regardless of its color when we unzoom. Is that possible to however to set a different color (red, blue and green specific) when the group is zoomed?

    Yes, you can freely set the appearance of your markers (they can have different icons) that are clustered by the MarkerClusterer. Then after zoom MarkerClusterer will show your colored markers.