Permalink
Browse files

Array access => tile

  • Loading branch information...
1 parent 2b54c28 commit 3a6efaa3504340c6a11e90abd2d975d7869c8d82 @CodeJosch committed Aug 30, 2011
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/layer/tile/TileLayer.js
@@ -176,15 +176,17 @@ L.TileLayer = L.Class.extend({
// remove tile if it's out of bounds
if (x < bounds.min.x || x > bounds.max.x || y < bounds.min.y || y > bounds.max.y) {
-
- this.fire("tileunload", {tile: this._tiles[key], url: this._tiles[key].src});
-
+
+ var tile = this._tiles[key];
+ this.fire("tileunload", {tile: tile, url: tile.src});
+
// evil, don't do this! crashes Android 3, produces load errors, doesn't solve memory leaks
// this._tiles[key].src = '';
- if (this._tiles[key].parentNode == this._container) {
- this._container.removeChild(this._tiles[key]);
+ if (tile.parentNode == this._container) {
+ this._container.removeChild(tile);
}
+ // could be tile...?
delete this._tiles[key];
}
}

0 comments on commit 3a6efaa

Please sign in to comment.