diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js index 4b9ed04b7..e5109022b 100644 --- a/src/MarkerCluster.js +++ b/src/MarkerCluster.js @@ -115,7 +115,7 @@ L.MarkerCluster = L.Marker.extend({ } if (result) { - if (!this._zoom) { + if (!('_zoom' in this)) { this.setIcon(this._group.options.iconCreateFunction(this._childCount)); } this._recalculateBounds(); diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 88faebe41..6f57ab09c 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -257,8 +257,8 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? { this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel - this._topClusterLevel._zoom + 1, this._getExpandedVisibleBounds()); }, _animationAddLayer: function (layer, newCluster) { - L.FeatureGroup.prototype.addLayer.call(this, newCluster); - if (newCluster !== layer && newCluster._childCount === 2) { + L.FeatureGroup.prototype.addLayer.call(this, layer); + if (newCluster !== true && newCluster._childCount === 2) { newCluster._recursivelyRemoveChildrenFromMap(newCluster._bounds, 1); } } @@ -377,7 +377,7 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? { var me = this; L.FeatureGroup.prototype.addLayer.call(this, layer); - if (newCluster !== layer) { + if (newCluster !== true) { if (newCluster._childCount > 2) { //Was already a cluster this._forceLayout();