Created
July 28, 2011 21:39
-
-
Save gjcourt/1112643 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.decay = function(feat, time, callback) { | |
var steps = 100; | |
var ts = time / steps; | |
for (var i = 0; i < steps; ++i) { | |
var opacity = 1 - ((i / steps)*.5); | |
(function(i, opacity){setTimeout(function() { | |
feat.style.fillOpacity = opacity; | |
feat.style.pointRadius = 4 * opacity; | |
commentsLayer.drawFeature(feat); | |
if (i == steps - 1) { | |
callback(feat); | |
} | |
}, i * ts)})(i, opacity); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment