diff --git a/src/MarkerCluster.js b/src/MarkerCluster.js index 8d2a0f884..72b35c0a9 100644 --- a/src/MarkerCluster.js +++ b/src/MarkerCluster.js @@ -49,7 +49,6 @@ L.MarkerCluster = L.Marker.extend({ this._expandBounds(new1); }, - //TODO: Replace with L.LatLngBounds _expandBounds: function (marker) { if (marker instanceof L.MarkerCluster) { diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 5fbeb3f20..0a846d432 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -18,7 +18,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ c += 'large'; } - return new L.DivIcon({ html: '
' + childCount + '
', elementType: 'span', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) }); + return new L.DivIcon({ html: '
' + childCount + '
', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) }); } }, @@ -198,6 +198,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ var me = this; setTimeout(function () { me._animationStart(); + for (var j = 0; j < newClusters.clusters.length; j++) { + var v = newClusters.clusters[j]; + if (v._icon) { + v.setLatLng(v._latlng); + } + } me._animationZoomOut(newClusters.clusters, 1); }, 0);