Use getTile() instead of imgDiv to get the correct element
The correct way to get the markup of a tile is to use getTile() - the imgDiv will only be available if the tile does not use a frame.
This commit is contained in:
committed by
Bart van den Eijnden
parent
d0f8fa3ecf
commit
1223ea339d
@@ -1100,7 +1100,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
this.events.triggerEvent("tileloadstart", {tile: tile});
|
||||
this.numLoadingTiles++;
|
||||
if (!this.singleTile && this.backBuffer && this.gridResolution === this.backBufferResolution) {
|
||||
OpenLayers.Element.addClass(tile.imgDiv, replacingCls);
|
||||
OpenLayers.Element.addClass(tile.getTile(), replacingCls);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1112,13 +1112,14 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
aborted: aborted
|
||||
});
|
||||
if (!this.singleTile && !aborted && this.backBuffer && this.gridResolution === this.backBufferResolution) {
|
||||
if (OpenLayers.Element.getStyle(tile.imgDiv, 'display') === 'none') {
|
||||
var tileDiv = tile.getTile();
|
||||
if (OpenLayers.Element.getStyle(tileDiv, 'display') === 'none') {
|
||||
var bufferTile = document.getElementById(tile.id + '_bb');
|
||||
if (bufferTile) {
|
||||
bufferTile.parentNode.removeChild(bufferTile);
|
||||
}
|
||||
}
|
||||
OpenLayers.Element.removeClass(tile.imgDiv, replacingCls);
|
||||
OpenLayers.Element.removeClass(tileDiv, replacingCls);
|
||||
}
|
||||
//if that was the last tile, then trigger a 'loadend' on the layer
|
||||
if (this.numLoadingTiles === 0) {
|
||||
|
||||
Reference in New Issue
Block a user