OpenLayers OpenLayers

Changeset 2048

Show
Ignore:
Timestamp:
12/13/06 15:22:30 (2 years ago)
Author:
crschmidt
Message:

Commit tschaub's patch for #447. This should let people who are having 'pink
tile' problems where right clicking returns the right tile not have problems
anymore. Note that this is seperate from TileCache related issues where
OpenLayers doesn't request tiles on a grid.

Note that I have no reason why this should work. In fact, I'd say it
*shouldn't* work, but other people are seeing this problem, so I'm glad
to have the code in trunk, since it doesn't change teh default behavior.

Thanks to Tim for the patch.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Util.js

    r1909 r2048  
    223223 
    224224OpenLayers.Util.onImageLoadErrorColor = "pink"; 
    225  
     225OpenLayers.IMAGE_RELOAD_ATTEMPTS = 0; 
    226226OpenLayers.Util.onImageLoadError = function() { 
    227     this.style.backgroundColor = OpenLayers.Util.onImageLoadErrorColor; 
     227    this._attempts = (this._attempts) ? (this._attempts + 1) : 1; 
     228    if(this._attempts <= OpenLayers.IMAGE_RELOAD_ATTEMPTS) { 
     229        this.src = this.src; 
     230    } else { 
     231        this.style.backgroundColor = OpenLayers.Util.onImageLoadErrorColor; 
     232    } 
    228233    this.style.display = ""; 
    229234};