1 /* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
 
   2  * See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
 
   3  * text of the license. */
 
   4 // @require: OpenLayers/Tile.js
 
   8 OpenLayers.Tile.Image = Class.create();
 
   9 OpenLayers.Tile.Image.prototype = 
 
  10   Object.extend( new OpenLayers.Tile(), {
 
  12     /** @type DOMElement img */
 
  18     * @param {OpenLayers.Grid} layer
 
  19     * @param {OpenLayers.Pixel} position
 
  20     * @param {OpenLayers.Bounds} bounds
 
  22     * @param {OpenLayers.Size} size
 
  24     initialize: function(layer, position, bounds, url, size) {
 
  25         OpenLayers.Tile.prototype.initialize.apply(this, arguments);
 
  29         if ((this.imgDiv != null) && (this.imgDiv.parentNode == this.layer.div)) {
 
  30             this.layer.div.removeChild(this.imgDiv);
 
  33         OpenLayers.Tile.prototype.destroy.apply(this, arguments);
 
  38     draw:function(transparent) {
 
  39         if (false) { // don't actually use the alpha PNG hack right now
 
  40                      // it has a fiercely bad effect on IE6's performance
 
  42             this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
 
  48             this.imgDiv = OpenLayers.Util.createImage(null,
 
  54         this.layer.div.appendChild(this.imgDiv);
 
  57     /** @final @type String */
 
  58     CLASS_NAME: "OpenLayers.Tile.Image"