Tile.Image.cloneMarkup renamed Tile.Image.createBackBuffer
This commit is contained in:
@@ -473,7 +473,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
backBuffer.style.height = '100%';
|
||||
for(var i=0, lenI=this.grid.length; i<lenI; i++) {
|
||||
for(var j=0, lenJ=this.grid[i].length; j<lenJ; j++) {
|
||||
var tile = this.grid[i][j].cloneMarkup();
|
||||
var tile = this.grid[i][j].createBackBuffer();
|
||||
if(!tile) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -320,21 +320,23 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: cloneMarkup
|
||||
* Clone this tile's markup.
|
||||
* Method: createBackBuffer
|
||||
* Create a backbuffer for this tile. A backbuffer isn't exactly a clone
|
||||
* of the tile's markup, because we want to avoid the reloading of the
|
||||
* image. So we clone the frame, and steal the image from the tile.
|
||||
*
|
||||
* Returns:
|
||||
* {DOMElement} The markup, or undefined if the tile has no image
|
||||
* or if it's currently loading.
|
||||
*/
|
||||
cloneMarkup: function() {
|
||||
createBackBuffer: function() {
|
||||
if(!this.imgDiv || this.isLoading) {
|
||||
return;
|
||||
}
|
||||
var clone = this.frame.cloneNode(false);
|
||||
clone.appendChild(this.imgDiv);
|
||||
var backBuffer = this.frame.cloneNode(false);
|
||||
backBuffer.appendChild(this.imgDiv);
|
||||
this.imgDiv = null;
|
||||
return clone;
|
||||
return backBuffer;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -195,19 +195,19 @@ OpenLayers.Tile.Image.IFrame = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: cloneMarkup
|
||||
* Override cloneMarkup to not attempt cloning when we use an iframe.
|
||||
* Moving an iframe from one element to another makes it necessary to
|
||||
* reload the iframe because its content is lost. So we just give up.
|
||||
* Method: createBackBuffer
|
||||
* Override createBackBuffer to do nothing when we use an iframe. Moving an
|
||||
* iframe from one element to another makes it necessary to reload the iframe
|
||||
* because its content is lost. So we just give up.
|
||||
*
|
||||
* Returns:
|
||||
* {DOMElement}
|
||||
*/
|
||||
cloneMarkup: function() {
|
||||
var clone;
|
||||
createBackBuffer: function() {
|
||||
var backBuffer;
|
||||
if(!this.useIFrame) {
|
||||
clone = OpenLayers.Tile.Image.prototype.cloneMarkup.call(this);
|
||||
backBuffer = OpenLayers.Tile.Image.prototype.createBackBuffer.call(this);
|
||||
}
|
||||
return clone;
|
||||
return backBuffer;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user