[OpenLayers-Dev] "Broken" images on 404 in IE w/ TileCache Layer

Matt Underwood sakkaku at gmail.com
Fri Nov 13 23:40:27 EST 2009

On Fri, Nov 13, 2009 at 8:47 PM, Roald de Wit <roald.dewit at lisasoft.com> wrote:
> Hi Matt,
> Matt Underwood wrote:
>> I wrote a layer that inherits Layer.TileCache to work with a slightly
>> different service (in this case images hosted on amazon's s3).  The
>> problem comes with IE which displays "broken" images on those that are
>> purposely omitted (404 is returned).  I looked at Tile.Image and it
>> seems to attempt to fail gracefully and replace the image from what I
>> understand.  Is there anything extra I need to do to ensure it
>> replaces the image on failure?  Any help or pointers would be greatly
>> appreciated, I was hoping to not have to debug Tile.Image :(
> If I understand you correctly, you want any 'broken' images to not be
> visible. This probably works fine in FF but in IE you see a tile with a
> broken image in it. Is that correct?
> If so, depending on the version of OL that you use you can do either the
> following:
> OL <= 2.8:
>   OpenLayers.Util.onImageLoadErrorColor = "transparent";
> OL > 2.8 (current trunk for example):
>    .olImageLoadError {
>        background-color: transparent !important;
>   }
> (you only need the "!important" bit if your CSS gets declared before OL
> styles get loaded (theme/default/style.css))
> Does this help or does something else go wrong?
> Regards,
> Roald

That doesn't seem to fix the issue.  It changes the color on the
error'd images but doesn't solve the border and icon IE throws in.  I
will try messing around with OpenLayers.Util.onImageLoadError and try
setting them to display: none or something.

If anyone wants a demo of what the issue is:   http://leetpi.com/map/
Project/Code is @: http://github.com/sakkaku/OpenLayers.SecondLife

If you pan down and to the left you can get some pretty early on or
paste map.zoomToRegion("Sandbox Island Extension"); Into firebug/dev
toolbar console.

More information about the Dev mailing list