This example demonstrates using custom Leaflet panes to control the z-index stacking order of different cluster groups. Useful when you need certain clusters to always appear above others.
// Create custom pane with higher z-index
map.createPane('paneB').style.zIndex = 610;
let markersA = new L.MarkerClusterGroup({
clusterPane: 'markerPane' // default
});
let markersB = new L.MarkerClusterGroup({
clusterPane: 'paneB' // custom pane
});
Features:
Use case: When displaying multiple marker categories that need specific layering order (e.g., prioritizing emergency markers over regular ones).