📌  相关文章
📜  谷歌地图标记集群的自定义图标 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:53.391000             🧑  作者: Mango

代码示例1
// 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})