Closed kjordahl closed 8 years ago
Works for me in Firefox and Chrome in OS X.
This is much less of a big deal with #66 improving performance, and WebGL seems to be smarter about using CPU when not visible anyway, but this still works and seems to do no harm.
I think the carto db layer was already doing this as well.
Uses
L.Util.requestAnimFrame
so that redraws will only happen while the browser window is active. This has the effect of pausing animation when the browser is hidden (or switched to another tab, etc.).Reference: http://www.paulirish.com/2011/requestanimationframe-for-smart-animating