[Pkg-javascript-commits] [leaflet-markercluster] 459/479: Implementation of LayerGroup.getLayer with really bad performance. fixes #244

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:01:07 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 243c4845978e499fd19e850485ee2f0b29018708
Author: danzel <danzel at localhost.geek.nz>
Date:   Wed Dec 18 11:21:06 2013 +1300

    Implementation of LayerGroup.getLayer with really bad performance. fixes #244
---
 src/MarkerClusterGroup.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 2b860af..aeac477 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -317,6 +317,19 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		return layers;
 	},
 
+	//Overrides LayerGroup.getLayer, WARNING: Really bad performance
+	getLayer: function (id) {
+		var result = null;
+
+		this.eachLayer(function (l) {
+			if (L.stamp(l) === id) {
+				result = l;
+			}
+		});
+
+		return result;
+	},
+
 	//Returns true if the given layer is in this MarkerClusterGroup
 	hasLayer: function (layer) {
 		if (!layer) {

-- 
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