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

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:27 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 1ade0834b8512836bb3f6ccbaf7f8ef6c3b0c5bf
Author: danzel <danzel at localhost.geek.nz>
Date:   Mon Aug 27 13:03:21 2012 +1200

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

diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js
index e7ef44f..7cc4df1 100644
--- a/dist/leaflet.markercluster-src.js
+++ b/dist/leaflet.markercluster-src.js
@@ -38,6 +38,17 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 	},
 
 	addLayer: function (layer) {
+
+		if (layer instanceof L.LayerGroup)
+		{
+			for (var i in layer._layers) {
+				if (layer._layers.hasOwnProperty(i)) {
+					this.addLayer(layer._layers[i]);
+				}
+			}
+			return this;
+		}
+
 		if (!this._map) {
 			this._needsClustering.push(layer);
 			return this;
@@ -1126,7 +1137,9 @@ L.DistanceGrid.prototype = {
 	getNearObject: function (point) {
 		var x = this._getCoord(point.x),
 		    y = this._getCoord(point.y),
-		    i, j, k, row, cell, len, obj;
+		    i, j, k, row, cell, len, obj, dist,
+		    closestDistSq = this._sqCellSize,
+			closest = null;
 
 		for (i = y - 1; i <= y + 1; i++) {
 			row = this._grid[i];
@@ -1138,16 +1151,17 @@ L.DistanceGrid.prototype = {
 
 						for (k = 0, len = cell.length; k < len; k++) {
 							obj = cell[k];
-							if (this._sqDist(obj._dGridPoint, point) < this._sqCellSize) {
-								return obj;
+							dist = this._sqDist(obj._dGridPoint, point);
+							if (dist < closestDistSq) {
+								closestDistSq = dist;
+								closest = obj;
 							}
 						}
 					}
 				}
 			}
 		}
-
-		return null;
+		return closest;
 	},
 
 	_getCoord: function (x) {
diff --git a/dist/leaflet.markercluster.js b/dist/leaflet.markercluster.js
index 50d1721..56d95e2 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,disableClusteringAtZoom:null},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAnimation=0,this._needsClustering=[],this._currentShownBounds=null},addLa [...]
\ 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,disableClusteringAtZoom:null},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),L.FeatureGroup.prototype.initialize.call(this,[]),this._inZoomAnimation=0,this._needsClustering=[],this._currentShownBounds=null},addLa [...]
\ 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