From 8be2cfbc7123e91294d0a06bedcd21d8162172a0 Mon Sep 17 00:00:00 2001 From: crschmidt Date: Sat, 26 Aug 2006 16:05:25 +0000 Subject: [PATCH] Make image load error color configurable. Document it. git-svn-id: http://svn.openlayers.org/trunk/openlayers@1386 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- build/docs.sh | 2 +- doc/Util.txt | 7 +++++++ lib/OpenLayers/Util.js | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 doc/Util.txt diff --git a/build/docs.sh b/build/docs.sh index 07c7917f06..25f223693b 100755 --- a/build/docs.sh +++ b/build/docs.sh @@ -1,7 +1,7 @@ #!/bin/sh rm ../doc/reference.html -CLASSES="Map Layer Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MouseToolbar Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds" +CLASSES="Map Layer Layer.HTTPRequest Layer.Grid Layer.WMS Layer.KaMap Layer.EventPane Layer.Google Layer.VirtualEarth Layer.Markers Layer.Text Layer.GeoRSS Layer.Boxes Icon Marker Marker.Box Tile Tile.Image Tile.WFS Control Control.LayerSwitcher Control.MouseDefaults Control.MouseToolbar Control.PanZoom Control.PanZoomBar Control.Permalink Control.Scale LonLat Size Pixel Bounds Util" echo " OpenLayers Class Reference Documentation diff --git a/doc/Util.txt b/doc/Util.txt new file mode 100644 index 0000000000..8e14fa816f --- /dev/null +++ b/doc/Util.txt @@ -0,0 +1,7 @@ +OpenLayers.Util + +Utility class. Stores a bunch of methods and settings that don't fit anywhere else. + +* Options + + OpenLayers.Util.onImageLoadErrorColor -- A string to set img.style.backgroundColor to if the onerror event fires for the image (useful for 500 errors from WMS, for example). diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index 3357b6e762..5eabc6392b 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -131,8 +131,10 @@ OpenLayers.Util.onImageLoad = function() { this.style.display = ""; }; +OpenLayers.Util.onImageLoadErrorColor = "pink"; + OpenLayers.Util.onImageLoadError = function() { - this.style.backgroundColor = "pink"; + this.style.backgroundColor = OpenLayers.Util.onImageLoadErrorColor; };