【问题标题】:Google map marker cluster... grouping customize by a value in markers谷歌地图标记集群...按标记中的值分组自定义
【发布时间】:2022-01-13 08:31:58
【问题描述】:

我想创建一个具有存储在标记中的特定值的集群。 这可能吗?

enter image description here

【问题讨论】:

标签: google-maps-api-3 google-maps-markers


【解决方案1】:

您可以像这样覆盖标记簇的图像路径

let markers = [marker1, marker2, marker3]; // list of markers with the specific value

markerClusterOptions = {
    styles: [
        {
            height: 53,
            width: 53,
            url: YOUR_ICON_PATH
        }
    ]
};

let markerCluster = new MarkerClusterer(map, markers, markerClusterOptions);

NBstyles 是一个列表,您可以有多个样式,例如 heightwidth

【讨论】:

    猜你喜欢
    • 2013-03-24
    • 1970-01-01
    • 1970-01-01
    • 2016-04-03
    • 2013-01-13
    • 1970-01-01
    • 1970-01-01
    • 2013-08-21
    相关资源
    最近更新 更多