When adding layers, don't add them to the map unless they are in the visible bounds. Fixes #69

This commit is contained in:
danzel
2012-09-28 09:37:10 +12:00
parent 9c4c4f9a25
commit 5d8b11c94d
+6 -4
View File
@@ -88,10 +88,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
}
}
if (this.options.animateAddingMarkers) {
this._animationAddLayer(layer, visibleLayer);
} else {
this._animationAddLayerNonAnimated(layer, visibleLayer);
if (this._currentShownBounds.contains(visibleLayer.getLatLng())) {
if (this.options.animateAddingMarkers) {
this._animationAddLayer(layer, visibleLayer);
} else {
this._animationAddLayerNonAnimated(layer, visibleLayer);
}
}
return this;
},