From 2d312835adc72384c2b7de00936b7704722f610a Mon Sep 17 00:00:00 2001 From: crschmidt Date: Wed, 17 May 2006 15:11:31 +0000 Subject: [PATCH] Can't setPosition before image exists. git-svn-id: http://svn.openlayers.org/trunk/openlayers@96 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Tile/Image.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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;