Commit tile-reuse branch back to trunk. This branch offers numerous performance

improvements in the form of reduced memory use and lower element creating costs,
hopefully making the OpenLayers code more usable in internet explorer as well
as less of a memory hog in Firefox and other browsers. Additionally, a buffer
is available around the main map grid which allows tiles to be loaded outside
of the viewing area for faster dragging.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@1137 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-08-09 03:47:33 +00:00
parent 51ac2b4acf
commit 0ba7961df4
9 changed files with 194 additions and 105 deletions

View File

@@ -10,7 +10,7 @@ OpenLayers.Tile.Image.prototype =
Object.extend( new OpenLayers.Tile(), {
/** @type DOMElement img */
imgDiv:null,
imgDiv: null,
/**
* @constructor
@@ -35,23 +35,45 @@ OpenLayers.Tile.Image.prototype =
/**
*/
draw:function(transparent) {
if (transparent) {
draw:function() {
if (this.layer.alpha) {
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
this.position,
this.size,
this.url,
"absolute");
"absolute",
null,
null,
true);
} else {
this.imgDiv = OpenLayers.Util.createImage(null,
this.position,
this.size,
this.url,
"absolute");
"absolute",
null,
true);
}
this.layer.div.appendChild(this.imgDiv);
},
moveTo: function (bounds, position) {
this.url = this.layer.getURL(bounds);
OpenLayers.Tile.prototype.moveTo.apply(this, arguments);
},
redraw: function () {
this.imgDiv.style.display = "none";
if (this.layer.alpha) {
OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,
null, this.position, this.size, this.url);
} else {
this.imgDiv.src = this.url;
OpenLayers.Util.modifyDOMElement(this.imgDiv,
null, this.position, this.size) ;
}
},
/** @final @type String */
CLASS_NAME: "OpenLayers.Tile.Image"
}