Using gmap3 and markerclusterer plus ( https://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/markerclustererplus/?r=394 )

how can I specify that a cluster should contain minimum 50 markers, for instance?

So, if they are less than 50 markers, they should not be grouped in a cluster.

有帮助吗?

解决方案 2

you can use the minimum cluster size: var mc = new MarkerClusterer(map, markers, {minimumClusterSize: 50});

其他提示

You can specify since what number you want to start clustering.

In the example below there's a cluster for more than 50, 100 or 150 markers.

marker: {
    values: $scope.json_coordinates,
        cluster:{
            radius:100,
                   // This style will be used for clusters with more than 50 markers
                    50: {
                        content: "<div class='cluster cluster-1'>CLUSTER_COUNT</div>",
                        width: 53,
                        height: 52
                    },
                   // This style will be used for clusters with more than 100 markers
                    100: {
                        content: "<div class='cluster cluster-2'>CLUSTER_COUNT</div>",
                        width: 56,
                        height: 55
                    },
                   // This style will be used for clusters with more than 150 markers
                   50: {
                        content: "<div class='cluster cluster-3'>CLUSTER_COUNT</div>",
                        width: 66,
                        height: 65
                   }
                },
                options: {
                    optimize: false,
                    icon: new google.maps.MarkerImage("/assets/images/overlay.png")
                }
            }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top