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:
@@ -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;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user