diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js index 5763f3ae9..5eb9c42dc 100644 --- a/src/MarkerCluster.js +++ b/src/MarkerCluster.js @@ -91,7 +91,7 @@ L.MarkerCluster = L.Marker.extend({ _removeChildMarker: function (marker) { var markers = this._markers, - group = this._group, i; + i; for (i = markers.length - 1; i >= 0; i--) { if (markers[i] === marker) { @@ -101,6 +101,7 @@ L.MarkerCluster = L.Marker.extend({ while (p) { p._childCount--; p._recalculateBounds(); + p._updateIcon(); p = p._parent; } return true; diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 2fabc920b..17627620d 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -103,12 +103,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ this._unspiderfyLayer(layer); } - if (!this._topClusterLevel._recursivelyRemoveLayer(layer)) { - //If this happens you are doing something bad - //If you've moved a marker that is in the cluster then that would be why - //console.log('failed to remove'); - var a = 0; - } + layer.__cluster._removeChildMarker(layer); return this; },