[OpenLayers-Users] Possible pink tile fix

Ben Brehmer bbrehmer at refractions.net
Mon Jan 14 12:15:43 EST 2008


Eric Lemoine wrote:

>On Jan 11, 2008 7:12 PM, Ben Brehmer <bbrehmer at refractions.net> wrote:
>  
>
>>Hello all,
>>
>>I just wanted to throw this out there as it might be useful to others;
>>We'd been having some problems with pink tiles, even with
>>IMAGE_RELOAD_ATTEMPTS set to a large number (10). The tile reload would
>>max out and the tile still wouldn't load properly in IE6 & 7. But adding
>>a dynamic dummy parameter to the problem images' URL seems to have
>>solved the problem.
>>
>>In the Util.js::onImageLoadError() function we simply modify the src of
>>the tile:
>>
>>var tmp_src = this.src;
>>this.src = tmp_src+"&retry="+this._attempts;
>>
>>This allows you to monitor how many times an image fails to load from
>>your server logs as well.
>>    
>>
>
>Ben,
>
>Thanks for sharing this thing. Was your problem related to some cache
>effect in IE?
>
>--
>Eric
>  
>
Eric,

I can't say for certain, but I have a suspicion that IE is caching 
failed images and not reloading them properly. Changing the URL seems to 
cause IE to register that this is a new image. But the key seems to be 
the dynamic URL. I've modified the 'alt' attribute in the past which 
seemed to work, but less effectively.

Ben



More information about the Users mailing list