diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 313d8e29a..476b8e032 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -547,8 +547,22 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ delete marker.__parent; }, + _isOrIsParent: function (el, oel) { + while (oel) { + if (el === oel) { + return true; + } + oel = oel.parentNode; + } + return false; + }, + _propagateEvent: function (e) { if (e.layer instanceof L.MarkerCluster) { + //Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget) + if (this._isOrIsParent(e.layer._icon, e.originalEvent.relatedTarget)) { + return; + } e.type = 'cluster' + e.type; }