Expected Behaviour: Icon to be updated with the provided config, it works for zoom level below 12 and above disableClusteringAtZoom option
Behaviour seen: “Uncaught TypeError: Cannot read properties of null (reading ‘style’)” while updating marker icon on zoom level 12 and above
Updating markerClusterGroup’s layer icon using the following method, which fails for zoom level 12 and above
function (imageUrl, markerClusterGroup) {
let layers = markerClusterGroup.getLayers();
let icon = L.icon({
iconUrl: imageUrl,
iconSize: [32, 32],
iconAnchor: [16, 32]
})
for (let layer of layers) {
if (layer.options.alt == 'store') {
layer.setIcon(icon);
}
}
Is it a valid way to update icons?