[Pkg-javascript-commits] [leaflet-markercluster] 374/479: #123 adding getVisibleParent for Marker (cherry picked from commit da2952d57bdab7af998ab480200c38212cbc662e)

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:58 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 4d3c96417228700f45fb2e52df487e51995254da
Author: Thierry Nicola <thierry.nicola at gmail.com>
Date:   Thu Jan 24 10:52:22 2013 +0100

    #123 adding getVisibleParent for Marker
    (cherry picked from commit da2952d57bdab7af998ab480200c38212cbc662e)
---
 src/MarkerClusterGroup.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js
index 8176db4..fa30630 100644
--- a/src/MarkerClusterGroup.js
+++ b/src/MarkerClusterGroup.js
@@ -390,6 +390,14 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({
 		this._map = null;
 	},
 
+   getVisibleParent: function(marker){
+      var vMarker = marker;
+      // TODO: Is this safe? No extra check needed to prevent infinite loop?
+      while(!vMarker._icon) {
+         vMarker = vMarker.__parent;
+      }
+      return vMarker;
+   },
 
 	//Remove the given object from the given array
 	_arraySplice: function (anArray, obj) {
@@ -909,4 +917,4 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? {
 
 L.markerClusterGroup = function (options) {
 	return new L.MarkerClusterGroup(options);
-};
\ 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