[OpenLayers-Users] Dealing with dead layers

Christopher Schmidt crschmidt at metacarta.com
Thu Oct 18 16:37:40 EDT 2007


On Thu, Oct 18, 2007 at 04:34:15PM -0400, Jeff Yutzler wrote:
> As of this writing, the NASA Global Mosaic layer (for example, the 
> second layer in http://www.openlayers.org/dev/examples/example.html) is 
> down.  These things happen from time to time for whatever reason.  The 
> problem we have is the behavior of OpenLayers.  The typical OpenLayers 
> response is to display a pink tile with the
> browser's "broken link" icon in the corner.  Users simply do not 
> appreciate this response.  It does not tell them what they need to know 
> (that a layer is dead), does not suggest a potential solution (of 
> turning off the dead layer), and worst of all, it covers up other 
> potentially useful layers.  Does anyone have a more gracious strategy 
> for dealing with this situation?

The OpenLayers.Util.onImageLoadError function is designed to be
overridden. The OpenLayers default behavior is just that. If you just
want to have images not show up, you can override the function, and
change the this.style.display = ""; to not be there -- then you'll not
see the tiles, as they'll stay hidden. 

OpenLayers.Util.onImageLoadErrorColor is also designed to be overridden
-- setting it to '' will cause the 'pink' to go away.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list