📅  最后修改于: 2022-03-11 15:00:53.391000             🧑  作者: Mango
// declare a function that return a marker
const renderer = {
render({ count, position }) {
return new google.maps.Marker({
label: { text: String(count), color: "white", fontSize: "12px" },
position,
icon: "url to the file",
// adjust zIndex to be above other markers
zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count,
})
}
}
// pass your function to the markerCluster constructor
const cluster = new MarkerClusterer({map, markers, renderer})