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

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:33 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 9163fc6080269e014bb9f9bd181e19c4b3c7f2b2
Author: danzel <danzel at localhost.geek.nz>
Date:   Tue Sep 11 16:24:40 2012 +1200

    Update build
---
 dist/leaflet.markercluster-src.js | 145 +++++++++++++++++++++-----------------
 dist/leaflet.markercluster.js     |   2 +-
 2 files changed, 81 insertions(+), 66 deletions(-)

diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js
index f0dacc0..cdffcdc 100644
--- a/dist/leaflet.markercluster-src.js
+++ b/dist/leaflet.markercluster-src.js
@@ -115,71 +115,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		return this;
 	},
 
-	//Remove the given object from the given array
-	_arraySplice: function (anArray, obj) {
-		for (var i = anArray.length - 1; i >= 0; i--) {
-			if (anArray[i] === obj) {
-				anArray.splice(i, 1);
-				return;
-			}
-		}
-	},
-
-	_removeLayer: function (marker, removeFromDistanceGrid) {
-		var gridClusters = this._gridClusters,
-			gridUnclustered = this._gridUnclustered,
-			map = this._map;
-
-		//Remove the marker from distance clusters it might be in
-		if (removeFromDistanceGrid) {
-			for (var z = this._maxZoom; z >= 0; z--) {
-				if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
-					break;
-				}
-			}
-		}
-
-		//Work our way up the clusters removing them as we go if required
-		var cluster = marker.__parent,
-			markers = cluster._markers,
-			otherMarker;
-
-		//Remove the marker from the immediate parents marker list
-		this._arraySplice(markers, marker);
-
-		while (cluster) {
-			cluster._childCount--;
-
-			if (cluster._zoom < 0) {
-				//Top level, do nothing
-				break;
-			} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required
-				//We need to push the other marker up to the parent
-				otherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0];
-
-				//Update distance grid
-				gridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom));
-				gridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom));
-
-				//Move otherMarker up to parent
-				this._arraySplice(cluster.__parent._childClusters, cluster);
-				cluster.__parent._markers.push(otherMarker);
-				otherMarker.__parent = cluster.__parent;
-
-				if (cluster._icon) {
-					//Cluster is currently on the map, need to put the marker on the map instead
-					L.FeatureGroup.prototype.removeLayer.call(this, cluster);
-					L.FeatureGroup.prototype.addLayer.call(this, otherMarker);
-				}
-			} else {
-				cluster._recalculateBounds();
-				cluster._updateIcon();
-			}
-
-			cluster = cluster.__parent;
-		}
-	},
-
 	clearLayers: function () {
 		//Need our own special implementation as the LayerGroup one doesn't work for us
 
@@ -220,6 +155,20 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		return res;
 	},
 
+	zoomToShowLayer: function (layer, callback) {
+		layer.__parent.zoomToBounds();
+		setTimeout(function () {
+			if (layer._icon) {
+				callback();
+			} else {
+				layer.__parent.spiderfy();
+				setTimeout(function () {
+					callback();
+				}, L.DomUtil.TRANSITION ? 250 : 0); //TODO: This is hardcoded based on the time to spiderfy
+			}
+		}, L.DomUtil.TRANSITION ? 600 : 0); //TODO: This is hardcoded based on the leaflet time to zoom
+	},
+
 	//Overrides FeatureGroup.onAdd
 	onAdd: function (map) {
 		L.FeatureGroup.prototype.onAdd.call(this, map);
@@ -268,6 +217,72 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		L.FeatureGroup.prototype.onRemove.call(this, map);
 	},
 
+
+	//Remove the given object from the given array
+	_arraySplice: function (anArray, obj) {
+		for (var i = anArray.length - 1; i >= 0; i--) {
+			if (anArray[i] === obj) {
+				anArray.splice(i, 1);
+				return;
+			}
+		}
+	},
+
+	_removeLayer: function (marker, removeFromDistanceGrid) {
+		var gridClusters = this._gridClusters,
+			gridUnclustered = this._gridUnclustered,
+			map = this._map;
+
+		//Remove the marker from distance clusters it might be in
+		if (removeFromDistanceGrid) {
+			for (var z = this._maxZoom; z >= 0; z--) {
+				if (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {
+					break;
+				}
+			}
+		}
+
+		//Work our way up the clusters removing them as we go if required
+		var cluster = marker.__parent,
+			markers = cluster._markers,
+			otherMarker;
+
+		//Remove the marker from the immediate parents marker list
+		this._arraySplice(markers, marker);
+
+		while (cluster) {
+			cluster._childCount--;
+
+			if (cluster._zoom < 0) {
+				//Top level, do nothing
+				break;
+			} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required
+				//We need to push the other marker up to the parent
+				otherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0];
+
+				//Update distance grid
+				gridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom));
+				gridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom));
+
+				//Move otherMarker up to parent
+				this._arraySplice(cluster.__parent._childClusters, cluster);
+				cluster.__parent._markers.push(otherMarker);
+				otherMarker.__parent = cluster.__parent;
+
+				if (cluster._icon) {
+					//Cluster is currently on the map, need to put the marker on the map instead
+					L.FeatureGroup.prototype.removeLayer.call(this, cluster);
+					L.FeatureGroup.prototype.addLayer.call(this, otherMarker);
+				}
+			} else {
+				cluster._recalculateBounds();
+				cluster._updateIcon();
+			}
+
+			cluster = cluster.__parent;
+		}
+	},
+
 	//Overrides FeatureGroup._propagateEvent
 	_propagateEvent: function (e) {
 		if (e.target instanceof L.MarkerCluster) {
diff --git a/dist/leaflet.markercluster.js b/dist/leaflet.markercluster.js
index 0cf3fc2..ccf2f7f 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