Can someone please explain to me why when I move point from one layer to another by doing this:
var previousLayer = activeItem.getLayers()[0];
activeItem.removeLayer(previousLayer); // activeItem is FeatureGroup
mapItems.addLayer(previousLayer); // mapItems is MarkerClusterGroup
And then try to change a marker class with:
previousLayer._icon.classList.remove('marker-active');
previousLayer._icon.classList.add('marker-shown');
I get and error that _icon is null when that marker goes inside a visible cluster on the map?
Is it some kind of MarkerCluster bug or I am missing something?
P.S. I tried to find parent cluster, cycle through all markers inside it and all of those markers don't have _icon option...
angular.forEach(mapItems.getVisibleParent(previousLayer)._markers, function (marker) {
console.log(marker._icon); // error every time
});