Working towards getting addLayer/removeLayer working again

This commit is contained in:
danzel
2012-07-25 15:33:57 +12:00
parent 7537fb0986
commit 7ceb7b01db
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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();
+3 -3
View File
@@ -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();