Image loading performance improvements

Performance improvements are achieved by using requestAnimationFrame when
a tile's visibility changes, and by not starting with a blank image when
creating a new tile image. It seems that even Firefox does not show a
loading placeholder when the tile is made visible in an animation.
This commit is contained in:
ahocevar
2012-10-05 09:24:53 +02:00
parent e3a5091ebd
commit 7e5e221c8d
2 changed files with 32 additions and 35 deletions

View File

@@ -2,8 +2,10 @@
<head>
<script src="../OLLoader.js"></script>
<script type="text/javascript">
// turn off animation frame handling, so we can check img urls in tests
// turn off tile queue, so we can check img urls in tests
delete OpenLayers.Layer.Grid.prototype.queueTileDraw;
// turn off animation, so we don't need to test asynchronously
OpenLayers.Animation.requestFrame = function(fn) { fn(); };
var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
var tile;