multiple MarkerClusterGroup on one map
See original GitHub issueI have this code, but if i use more MarkerClusterGroup, result is strange. Clusters is not in layers, but all together and changing level (i) if i use zoom on map.
for(var i = 0; i < addressLayers.length; i++) {
var cluster = new L.MarkerClusterGroup({
iconCreateFunction: function(cl) {
return new L.DivIcon({ html: '<div class="cluster'+i+'"><i></i><b><span>' + cl.getChildCount() + '</span></b></div>' });
},
maxClusterRadius: 50
});
for(var j = 0; j < addressLayers[i].length; j++){
cluster.addLayer(addressLayers[i][j]);
}
map.addLayer(cluster);
}
Is there a way to have a cluster in layers?
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Using several Marker Cluster Groups displays overlapping ...
Simply create 1 subgroup per "switchable" Features Group and set their parent as your single Marker Cluster Group: var map = L.map('map', ...
Read more >Leaflet.markercluster, markerClusterGroup into another ...
It behaves like a single marker cluster without any subgroups, ... you have to add them to map directly, not via main_cluster_test cluster:...
Read more >Leaflet.markercluster | Marker Clustering plugin for Leaflet
Leaflet.markercluster. Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps. Requires Leaflet 1.0.0.
Read more >Cluster multiple map services in leaflet
Solved: I am trying to cluster multiple layers in leaflet, ... as entire collections of features with the same geometry type in a...
Read more >Leaflet Markercluster: How To Open Multiple Cluster ...
a marker sometimes goes missing when markers from more than one cluster It looks like you have multiple MarkerClusterGroups on your map.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
i see http://jsfiddle.net/cxZRM/92/
sorry for mistake
No worries, enjoy 😃