Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.48 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. this.decay = function(feat, time, callback) {
  2.     var steps = 100;
  3.     var ts = time / steps;
  4.     for (var i = 0; i < steps; ++i) {
  5.         var opacity = 1 - ((i / steps)*.5);
  6.         (function(i, opacity){setTimeout(function() {
  7.             feat.style.fillOpacity = opacity;
  8.             feat.style.pointRadius = 4 * opacity;
  9.             commentsLayer.drawFeature(feat);
  10.             if (i == steps - 1) {
  11.                 callback(feat);
  12.             }
  13.         }, i * ts)})(i, opacity);
  14.     }
  15. };