how can i change cluster icon? i wolud like to have same icon, with some other color than blue.
The Google Maps APIs now support you in creating beautiful styled maps for your Android and iOS apps as well as your website using the same JSON style object.
You need to use styles parameter when initializing MarkerClusterer object - the code below shows default styles so if you want to recolour one of the icons just change the relevant url to your image...
//set style options for marker clusters (these are the default styles) mcOptions = {styles: [{ height: 53, url: "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/images/m1.png", width: 53 }, { height: 56, url: "https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images/m2.png", width: 56 }, { height: 66, url: "https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images/m3.png", width: 66 }, { height: 78, url: "https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images/m4.png", width: 78 }, { height: 90, url: "https://github.com/googlemaps/js-marker-clusterer/tree/gh-pages/images/m5.png", width: 90 }]} //init clusterer with your options var mc = new MarkerClusterer(map, markers, mcOptions);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With