Fix-Fix double childCount adding bug. Fix broken icon after add bug

This commit is contained in:
danzel
2012-07-20 16:15:07 +12:00
parent a944d7de44
commit 55d221c9e1
+2 -3
View File
@@ -87,7 +87,6 @@ L.MarkerCluster = L.Marker.extend({
if (!this._haveGeneratedChildClusters && this._canAcceptPosition(layer.getLatLng(), zoom)) {
//Don't need to cluster it in as we haven't clustered
this._addChild(layer);
this._childCount++;
result = true;
} else {
for (var i = this._childClusters.length - 1; i >= 0; i--) {
@@ -119,9 +118,9 @@ L.MarkerCluster = L.Marker.extend({
}
if (result) {
//if (!this._zoom) { //TODO: Enable this when i've tracked the weird bug
if (!this._zoom) {
this.setIcon(this._group.options.iconCreateFunction(this._childCount));
//}
}
this._recalculateBounds();
}
if (result === true) {