Dokumentation: Google Maps – MarkerClusterer.Options.Styles

Nach dem suchen und kramen in der .js Datei hab ich nun die Stellen gefunden um das entsprechende Cluster Icon und den Text zu formatieren.

Folgende Array kann dem MakersClusterer als style übergeben werden:

url: [string] – Path and Name to Image
height: [int] – Height in Pixel
weight: [int] – Weight in Pixel
textColor: [colorcode] – Font Color HexCode
anchor: [array{top,left,bottom,right} [INT]] – Font Padding
textSize: [int] – Font Size in Pixcel
backgroundPosition: [string] – CSS Background Position

Beispiel:

var clusterStyles = [
{
color: ‚black‘,
url: ‚#variables.domain#/media/img/markers/m2gh.png‘,
height: 50,
width: 55
},
{
color: ‚black‘,
url: ‚#variables.domain#/media/img/markers/m2gh.png‘,
height: 50,
width: 55
},
{
color: ‚black‘,
url: ‚#variables.domain#/media/img/markers/m2gh.png‘,
height: 50,
width: 55
}

];
/* Cluster Optionen */
var mcOptions = { gridSize: 50, maxZoom: 19, styles: clusterStyles}

/* Cluser erstellen */
var Cluster = new MarkerClusterer(map,Markers,mcOptions);