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

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:40 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 e6b67b0b3917559cbac2d47b7185f5c5ca1d9e4f
Author: danzel <danzel at localhost.geek.nz>
Date:   Thu Nov 1 09:45:37 2012 +1300

    Update build
---
 dist/leaflet.markercluster-src.js | 21 +++++++++++++++------
 dist/leaflet.markercluster.js     |  2 +-
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/dist/leaflet.markercluster-src.js b/dist/leaflet.markercluster-src.js
index ed0df7a..4aa326e 100644
--- a/dist/leaflet.markercluster-src.js
+++ b/dist/leaflet.markercluster-src.js
@@ -117,8 +117,6 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			layer.setOpacity(1);
 		}
 
-		delete layer.__parent;
-
 		return this;
 	},
 
@@ -131,6 +129,11 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 		for (var i = 0, l = layersArray.length; i < l; i++) {
 			var m = layersArray[i];
+
+			if (this.hasLayer(m)) {
+				continue;
+			}
+
 			this._addLayer(m, this._maxZoom);
 
 			//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will
@@ -396,6 +399,8 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 
 			cluster = cluster.__parent;
 		}
+
+		delete marker.__parent;
 	},
 
 	//Overrides FeatureGroup._propagateEvent
@@ -554,10 +559,10 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 			//Try find a marker close by to form a new cluster with
 			closest = gridUnclustered[zoom].getNearObject(markerPoint);
 			if (closest) {
-				if (closest.__parent) {
+				var parent = closest.__parent;
+				if (parent) {
 					this._removeLayer(closest, false);
 				}
-				var parent = closest.__parent;
 
 				//Create new cluster with these 2 in it
 
@@ -1537,6 +1542,10 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 	}
 } : {
 	//Animated versions here
+	SVG_ANIMATION: (function () {
+		return document.createElementNS('http://www.w3.org/2000/svg', 'animate').toString().indexOf('SVGAnimate') > -1;
+	}()),
+
 	_animationSpiderfy: function (childMarkers, positions) {
 		var me = this,
 			group = this._group,
@@ -1579,7 +1588,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 			m._spiderLeg = leg;
 
 			//Following animations don't work for canvas
-			if (!L.Path.SVG) {
+			if (!L.Path.SVG || !this.SVG_ANIMATION) {
 				continue;
 			}
 
@@ -1638,7 +1647,7 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 			map = group._map,
 			thisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),
 			childMarkers = this.getAllChildMarkers(),
-			svg = L.Path.SVG,
+			svg = L.Path.SVG && this.SVG_ANIMATION,
 			m, i, a;
 
 		group._animationStart();
diff --git a/dist/leaflet.markercluster.js b/dist/leaflet.markercluster.js
index 6745ef6..472e6ed 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,animateAddingMarkers:!1,polygonOptions:{}},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 [...]
\ 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,animateAddingMarkers:!1,polygonOptions:{}},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 [...]
\ 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