[Pkg-javascript-commits] [leaflet-markercluster] 81/479: Add a currently unworking animation for the spider legs

Jonas Smedegaard dr at jones.dk
Thu Oct 16 16:00:12 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 ffbe50b7404a7d993910cb054190390dccb31b51
Author: danzel <danzel at localhost.geek.nz>
Date:   Tue Jul 24 11:04:25 2012 +1200

    Add a currently unworking animation for the spider legs
---
 src/MarkerCluster.Spiderfier.js | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/src/MarkerCluster.Spiderfier.js b/src/MarkerCluster.Spiderfier.js
index 39d386a..23752e4 100644
--- a/src/MarkerCluster.Spiderfier.js
+++ b/src/MarkerCluster.Spiderfier.js
@@ -153,6 +153,33 @@ L.MarkerCluster.include(!L.DomUtil.TRANSITION ? {
 					leg = new L.Polyline([me._latlng, m._latlng], { weight: 1.5, color: '#222' });
 					map.addLayer(leg);
 					m._spiderLeg = leg;
+
+
+
+					//Chrome bug that prevents this working:
+					//  http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements
+
+					//http://stackoverflow.com/questions/5924238/how-do-you-animate-an-svg-path-in-ios
+					//http://dev.opera.com/articles/view/advanced-svg-animation-techniques/
+
+					//var length = leg._path.getTotalLength();
+					//leg._path.setAttribute("stroke-dasharray", length + "," + length);
+
+					var xmlns = "http://www.w3.org/2000/svg";
+					var anim = document.createElementNS(xmlns, "animate");
+					//anim.setAttribute("attributeName", "stroke-dashoffset");
+					//anim.setAttribute("begin", "indefinite");
+					//anim.setAttribute("from", length);
+					//anim.setAttribute("to", 0);
+					//anim.setAttribute("dur", "1s");
+
+					anim.setAttribute("attributeName", "stroke-opacity");
+					anim.setAttribute("from", 1);
+					anim.setAttribute("to", 0);
+					anim.setAttribute("begin", "indefinite");
+					anim.setAttribute("dur", 5);
+					leg._path.appendChild(anim);
+					anim.beginElement();
 				}
 
 

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