Simplified tile queue; using the tile's beforedraw listener.

Since draw is the only tile operation that we defer, the tile queue can be an array of tiles and queue handling can be simplified. We now use the beforedraw event to defer drawing, and remove all occurrences of a tile from the tile queue when we draw it.

Instead of layers that want to defer tile drawing having to override the tile's draw method, layers can now abort drawing by returning false from a beforedraw listener, and later call draw(true) to draw the tile directly, without clearing it first.
This commit is contained in:
ahocevar
2012-01-28 16:12:29 +01:00
parent 0e435b5483
commit dde45696f7
11 changed files with 93 additions and 77 deletions

View File

@@ -2,6 +2,9 @@
<head>
<script src="../../OLLoader.js"></script>
<script type="text/javascript">
// turn off animation frame handling, so we can check img urls in tests
delete OpenLayers.Layer.Grid.prototype.queueTileDraw;
var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
var isIE = (navigator.userAgent.indexOf("MSIE") != -1);