you can use the minimum cluster size: var mc = new MarkerClusterer(map, markers, {minimumClusterSize: 50});
cluster with gmap3 and markerclusterer plus
-
22-07-2023 - |
Domanda
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.
Soluzione 2
Altri suggerimenti
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")
}
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow