| | 219 | // Bind a listener to the onerror of the image div so that we |
|---|
| | 220 | // can registere when a tile has finished loading with errors. |
|---|
| | 221 | var onerror = function() { |
|---|
| | 222 | |
|---|
| | 223 | // If we have gone through all image reload attempts, it is time |
|---|
| | 224 | // to realize that we are done with this image. Since |
|---|
| | 225 | // OpenLayers.Util.onImageLoadError already has taken care about |
|---|
| | 226 | // the error, we can continue as if the image was loaded |
|---|
| | 227 | // successfully. |
|---|
| | 228 | if (this.imgDiv._attempts > OpenLayers.IMAGE_RELOAD_ATTEMPTS) { |
|---|
| | 229 | onload.call(this); |
|---|
| | 230 | } |
|---|
| | 231 | }; |
|---|
| | 232 | OpenLayers.Event.observe(this.imgDiv, "error", |
|---|
| | 233 | OpenLayers.Function.bind(onerror, this)); |
|---|