Fix loading of blank tiles on some browsers to use the asset pipeline
authorTom Hughes <tom@compton.nu>
Mon, 19 Dec 2011 17:54:46 +0000 (17:54 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 19 Dec 2011 17:56:00 +0000 (17:56 +0000)
app/assets/javascripts/openlayers.js.erb

index 206e717..f4964b8 100644 (file)
@@ -59,3 +59,12 @@ OpenLayers.Util.modifyAlphaImageDiv = function(div, id, px, sz, imgURL,
                                                    position, border, sizing, 
                                                    opacity);
 };
+
+OpenLayers.Tile.Image.clear = function() {
+    if (this.imgDiv) {
+        this.hide();
+        if (OpenLayers.Tile.Image.useBlankTile) { 
+            this.imgDiv.src = "<%= asset_path 'img/blank.gif' %>";
+        }    
+    }
+};