So I have a couple of stores as layers on my map. All my stores are added to the MarkerCluster and that one is added to map, everything works fine. But I want to display a short info about the store when it's in my viewPort.
With usual stores (layers) this was working first try, but the clustered Group does not work :( I started with this one:
map.eachLayer(function(layer)
but it did not just give me the stores, but alot of things. So I went further to:
if(map.getBounds().contains(layer.getLatLng()))
and that worked as intended.
Not so with Clusterers. I tried iterating over things like that:
$.each(layer._childClusters[0]._markers, function()
{
var element = this;
if(map.getBounds().contains(element.getLatLng()))
{ ....
But it just won't work. Sometimes I get the clusteredGroup (consisting of 4 stores) as 1 layer ... and one store. Sometimes 40.
What is the best way to determine the stores inside of the cluster itself ?