Files
openlayers/lib/OpenLayers/Tile/Image.js
Schuyler Erle ead31f6dc6 Added license headers to all JS source files.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@657 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-06-21 15:22:48 +00:00

51 lines
1.5 KiB
JavaScript

/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
* text of the license. */
// @require: OpenLayers/Tile.js
/**
* @class
*/
OpenLayers.Tile.Image = Class.create();
OpenLayers.Tile.Image.prototype =
Object.extend( new OpenLayers.Tile(), {
/** @type DOMElement img */
imgDiv:null,
/**
* @constructor
*
* @param {OpenLayers.Grid} layer
* @param {OpenLayers.Pixel} position
* @param {OpenLayers.Bounds} bounds
* @param {String} url
* @param {OpenLayers.Size} size
*/
initialize: function(layer, position, bounds, url, size) {
OpenLayers.Tile.prototype.initialize.apply(this, arguments);
},
destroy: function() {
if ((this.imgDiv != null) && (this.imgDiv.parentNode == this.layer.div)) {
this.layer.div.removeChild(this.imgDiv);
}
this.imgDiv = null;
OpenLayers.Tile.prototype.destroy.apply(this, arguments);
},
/**
*/
draw:function() {
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
this.position,
this.size,
this.url,
"absolute");
this.layer.div.appendChild(this.imgDiv);
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Tile.Image"
}
);