diff --git a/lib/OpenLayers/Util.js b/lib/OpenLayers/Util.js index f250977828..1ca26c0fab 100644 --- a/lib/OpenLayers/Util.js +++ b/lib/OpenLayers/Util.js @@ -175,6 +175,16 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border, image = document.createElement("img"); + //set generic properties + if (!id) { + id = OpenLayers.Util.createUniqueID("OpenLayersDiv"); + } + if (!position) { + position = "relative"; + } + OpenLayers.Util.modifyDOMElement(image, id, px, sz, position, + border, null, opacity); + if(delayDisplay) { image.style.display = "none"; OpenLayers.Event.observe(image, "load", @@ -191,15 +201,6 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border, image.src = imgURL; } - //set generic properties - if (!id) { - id = OpenLayers.Util.createUniqueID("OpenLayersDiv"); - } - if (!position) { - position = "relative"; - } - OpenLayers.Util.modifyDOMElement(image, id, px, sz, position, - border, null, opacity); return image;