Remove images from dom when replacing them with cached images

This commit is contained in:
ahocevar
2012-12-17 18:29:47 +01:00
parent faa0e60b99
commit 64df7e3d04
2 changed files with 7 additions and 1 deletions

View File

@@ -330,6 +330,9 @@ OpenLayers.TileManager = OpenLayers.Class({
// only use image from cache if it is not on a layer already
if (img && (!img.parentNode ||
OpenLayers.Element.hasClass(img.parentNode, 'olBackBuffer'))) {
if (tile.imgDiv) {
tile.layer.div.removeChild(tile.imgDiv);
}
tile.imgDiv = img;
OpenLayers.Util.removeItem(this.tileCacheIndex, tile.url);
this.tileCacheIndex.push(tile.url);