take advantage of createImage to set the position on creation. change point to pixel

git-svn-id: http://svn.openlayers.org/trunk/openlayers@159 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-18 18:29:31 +00:00
parent 4d27baa639
commit 525c40fd4d

View File

@@ -24,18 +24,19 @@ OpenLayers.Tile.Image.prototype =
draw:function() {
OpenLayers.Tile.prototype.draw.apply(this, arguments);
this.img = OpenLayers.Util.createImage(this.url,
this.size);
this.size,
null,
"absolute");
},
/**
* @param OpenLayers.Pixel
*/
setPosition:function(point) {
setPosition:function(pixel) {
if (this.img) {
this.img.style.top = point.y + "px";
this.img.style.left = point.x + "px";
this.img.style.position = "absolute";
this.position = point;
this.img.style.top = pixel.y + "px";
this.img.style.left = pixel.x + "px";
this.position = pixel;
}
},