diff --git a/lib/OpenLayers/Tile/Image.js b/lib/OpenLayers/Tile/Image.js index 6b958d2cfb..74337ce5aa 100644 --- a/lib/OpenLayers/Tile/Image.js +++ b/lib/OpenLayers/Tile/Image.js @@ -18,10 +18,12 @@ OpenLayers.Tile.Image.prototype = * @param OpenLayers.Pixel */ setPosition:function(point) { - this.img.style.top = point.y+"px"; - this.img.style.left = point.x+"px"; - this.img.style.position = "absolute"; - this.position = point; + if (img) { + this.img.style.top = point.y+"px"; + this.img.style.left = point.x+"px"; + this.img.style.position = "absolute"; + this.position = point; + } }, getPosition: function() { return this.position;