Update build

This commit is contained in:
danzel
2014-05-28 11:01:36 +12:00
parent 254198ad47
commit fe3bbd3760
2 changed files with 16 additions and 5 deletions
+15 -4
View File
@@ -428,16 +428,27 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
};
if (layer._icon && this._map.getBounds().contains(layer.getLatLng())) {
//Layer is visible ond on screen, immediate return
callback();
} else if (layer.__parent._zoom < this._map.getZoom()) {
//Layer should be visible now but isn't on screen, just pan over to it
//Layer should be visible at this zoom level. It must not be on screen so just pan over to it
this._map.on('moveend', showMarker, this);
this._map.panTo(layer.getLatLng());
} else {
var moveStart = function () {
this._map.off('movestart', moveStart, this);
moveStart = null;
};
this._map.on('movestart', moveStart, this);
this._map.on('moveend', showMarker, this);
this.on('animationend', showMarker, this);
this._map.setView(layer.getLatLng(), layer.__parent._zoom + 1);
layer.__parent.zoomToBounds();
if (moveStart) {
//Never started moving, must already be there, probably need clustering however
showMarker.call(this);
}
}
},
@@ -846,7 +857,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
//Incase we are starting to split before the animation finished
this._processQueue();
if (this._zoom < this._map._zoom && this._currentShownBounds.contains(this._getExpandedVisibleBounds())) { //Zoom in, split
if (this._zoom < this._map._zoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split
this._animationStart();
//Remove clusters now off screen
this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, this._zoom, this._getExpandedVisibleBounds());
@@ -1135,7 +1146,7 @@ L.MarkerCluster = L.Marker.extend({
mapZoom = map.getZoom(),
i;
//calculate how fare we need to zoom down to see all of the markers
//calculate how far we need to zoom down to see all of the markers
while (childClusters.length > 0 && boundsZoom > zoom) {
zoom++;
var newClusters = [];
+1 -1
View File
File diff suppressed because one or more lines are too long