[OpenLayers-Users] IE7 IMAGE_RELOAD_ATTEMPTS

Ben Brehmer bbrehmer at refractions.net
Wed Nov 14 19:52:44 EST 2007


Paul Spencer wrote:

>
> On 14-Nov-07, at 3:17 PM, Christopher Schmidt wrote:
>
>> On Wed, Nov 14, 2007 at 10:52:00AM -0800, Ben Brehmer wrote:
>>
>>> Thanks Roald,
>>>
>>> I just updated to trunk and still see broken tiles in IE7.
>>>
>>> Looking at my server logs I see a particular broken tile url coming  in
>>> once. Does IMAGE_RELOAD_ATTEMPTS cause OpenLayers to re-request a
>>> particular tile, or does it simply re-try to set the src on the  image?
>>
>>
>> There's not really any way for OpenLayers to do anything *other* than
>> this. Recently (~yesterday) I saw a report on another mailing list
>> (Boston Perlmonks, for the interested) that IE7 does not re-request  
>> from
>> server in some cases where a 404/error was returned for some unknown
>> reason. This may mean that the IMAGE_RELOAD_REQUESTS is doing  
>> everything
>> it can, but doesn't actually reload the tile: adding an 'alert'  message
>> in the callback (or turning on debugging and using console.log) might
>> let yo usee if that's the case, or if IE is just being stupid and not
>> actually requesting things from the server again.
>>
>
> Do you think it is possible that setting the source to some other  
> value (blank gif) and then back to the original source might trigger 
> a  reload?
>
> Paul

I've been playing around with this today and found that the following 
steps alleviate the problem immensly in IE7:

1. set the source to some other image
2. set the alt tag
3. set the source back to the original tile source

I do all this in the ImageLoadError() function (Util.js).

No idea why this works :) Maybe it forces some sort of refresh event in 
the DOM?

Ben





More information about the Users mailing list