So I've been noticing that pruneCluster.BuildLeafletCluster = function(cluster, position) {...} does not always return the correct cluster/position. When there are multiple clusters on the map, it sometimes return another cluster.
This happens sporadically. I'd say it happens 1 in 50 or 1 in 100? I tried tracking down the issue but the randomness of its occurrence makes it very difficult.
Can anyone provide some insights as to why this could be happening?
Sample code:
pruneCluster.BuildLeafletCluster = function(cluster, position) {
let m = new L.Marker(position, {
icon: pruneCluster.BuildLeafletClusterIcon(cluster)
});
m.on('click', function() {
let markers = cluster.GetClusterMarkers();
})
return m;
}
EDIT: I managed to catch one instance of this, where the cluster is empty (even though there is 21 markers in this cluster). console.log shows that the cluster object has these weird properties:
EDIT: I correct what I said earlier about it happening randomly. It does not happen randomly and happens to clusters in particular positions. Still trying to figure out the cause.
So I've been noticing that
pruneCluster.BuildLeafletCluster = function(cluster, position) {...}
does not always return the correct cluster/position. When there are multiple clusters on the map, it sometimes return another cluster.This happens sporadically. I'd say it happens 1 in 50 or 1 in 100? I tried tracking down the issue but the randomness of its occurrence makes it very difficult.
Can anyone provide some insights as to why this could be happening?
Sample code:
EDIT: I managed to catch one instance of this, where the cluster is empty (even though there is 21 markers in this cluster).
console.log
shows that thecluster
object has these weird properties:EDIT: I correct what I said earlier about it happening randomly. It does not happen randomly and happens to clusters in particular positions. Still trying to figure out the cause.