[Pkg-javascript-commits] [leaflet-markercluster] 249/479: Update build

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository leaflet-markercluster.

commit d4a06651bbd247798dabfbf70543338c674d503c
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Sep 20 11:29:21 2012 +1200

    Update build
---
 dist/leaflet.markercluster-src.js | 20 +++++++++++++++++---
 dist/leaflet.markercluster.js     |  2 +-
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js
index 534d175..ced60b4 100644
--- a/dist/leaflet.markercluster-src.js
+++ b/dist/leaflet.markercluster-src.js
@@ -101,6 +101,12 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 	},
 
 	removeLayer: function (layer) {
+
+		if (!this._map) {
+			this._arraySplice(this._needsClustering, layer);
+			return this;
+		}
+
 		if (!layer.__parent) {
 			return this;
 		}
@@ -181,12 +187,18 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			}
 		};
 
-		if ((layer._icon || layer.__parent._icon) && this._map.getBounds().contains(layer.__parent._latlng)) {
-			//Layer or cluster is already visible
-			showMarker.call(this);
+		if (layer._icon) {
+			callback();
+		} else if (layer.__parent._zoom < this._map.getZoom()) {
+			//Layer should be visible now but isn't on screen, just pan over to it
+			this._map.on('moveend', showMarker, this);
+			if (!layer._icon) {
+				this._map.panTo(layer.getLatLng());
+			}
 		} else {
 			this._map.on('moveend', showMarker, this);
 			this.on('animationend', showMarker, this);
+			this._map.setView(layer.getLatLng(), layer.__parent._zoom + 1);
 			layer.__parent.zoomToBounds();
 		}
 	},
@@ -637,6 +649,8 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 
 		//Need to add markers for those that weren't on the map before but are now
 		this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());
+		//Remove markers that were on the map before but won't be now
+		this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel, this._getExpandedVisibleBounds());
 	},
 	_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {
 		var bounds = this._getExpandedVisibleBounds();
diff --git a/dist/leaflet.markercluster.js b/dist/leaflet.markercluster.js
index dce9252..3424dfa 100644
--- a/dist/leaflet.markercluster.js
+++ b/dist/leaflet.markercluster.js
@@ -3,4 +3,4 @@
  Leaflet.markercluster is an open-source JavaScript library for Marker Clustering on leaflet powered maps.
  https://github.com/danzel/Leaflet.markercluster
 */
-(function(e,t){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,skipDuplicateAddTesting:!1,animateAddingMarkers:!1},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAn [...]
\ No newline at end of file
+(function(e,t){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,skipDuplicateAddTesting:!1,animateAddingMarkers:!1},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAn [...]
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/leaflet-markercluster.git



More information about the Pkg-javascript-commits mailing list