[OpenLayers-Commits] r5123 - sandbox/ahocevar/sldRenderer/lib/OpenLayers/Tile

commits at openlayers.org commits at openlayers.org
Tue Nov 6 11:21:48 EST 2007


Author: ahocevar
Date: 2007-11-06 11:21:46 -0500 (Tue, 06 Nov 2007)
New Revision: 5123

Modified:
   sandbox/ahocevar/sldRenderer/lib/OpenLayers/Tile/Image.js
Log:
Merging from r5107 to HEAD

Modified: sandbox/ahocevar/sldRenderer/lib/OpenLayers/Tile/Image.js
===================================================================
--- sandbox/ahocevar/sldRenderer/lib/OpenLayers/Tile/Image.js	2007-11-06 15:05:59 UTC (rev 5122)
+++ sandbox/ahocevar/sldRenderer/lib/OpenLayers/Tile/Image.js	2007-11-06 16:21:46 UTC (rev 5123)
@@ -207,6 +207,21 @@
         OpenLayers.Event.observe(this.imgDiv, 'load',
                                  OpenLayers.Function.bind(onload, this));
 
+        // Bind a listener to the onerror of the image div so that we
+        // can registere when a tile has finished loading with errors.
+        var onerror = function() {
+
+            // If we have gone through all image reload attempts, it is time
+            // to realize that we are done with this image. Since
+            // OpenLayers.Util.onImageLoadError already has taken care about
+            // the error, we can continue as if the image was loaded
+            // successfully.
+            if (this.imgDiv._attempts > OpenLayers.IMAGE_RELOAD_ATTEMPTS) {
+                onload();
+            }
+        };
+        OpenLayers.Event.observe(this.imgDiv, "error",
+                                 OpenLayers.Function.bind(onerror, this));
     },
 
     /**



More information about the Commits mailing list