Update build

This commit is contained in:
danzel
2013-01-09 11:28:49 +13:00
parent 0c0e3bc1ca
commit 25e07c8fe7
2 changed files with 20 additions and 3 deletions

View File

@@ -125,13 +125,14 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
//Takes an array of markers and adds them in bulk
addLayers: function (layersArray) {
var i, l, m;
if (!this._map) {
this._needsClustering = this._needsClustering.concat(layersArray);
return this;
}
for (var i = 0, l = layersArray.length; i < l; i++) {
var m = layersArray[i];
for (i = 0, l = layersArray.length; i < l; i++) {
m = layersArray[i];
if (this.hasLayer(m)) {
continue;
@@ -148,6 +149,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
}
}
}
//Update the icons of all those visible clusters that were affected
for (i in this._layers) {
if (this._layers.hasOwnProperty(i)) {
m = this._layers[i];
if (m instanceof L.MarkerCluster && m._iconNeedsUpdate) {
m._updateIcon();
}
}
}
this._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);
return this;
@@ -1715,6 +1727,11 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
for (i = childMarkers.length - 1; i >= 0; i--) {
m = childMarkers[i];
//Marker was added to us after we were spidified
if (!m._preSpiderfyLatlng) {
continue;
}
//Fix up the location to the real one
m.setLatLng(m._preSpiderfyLatlng);
delete m._preSpiderfyLatlng;

View File

File diff suppressed because one or more lines are too long