From 773fa91d1e11327d2f3491ac3df59da312cea3ee Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Fri, 13 Dec 2013 17:24:43 -0500 Subject: [PATCH] fix old IE and stricter jshinting --- build/hintrc.js | 1 + src/layer/tile/TileLayer.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build/hintrc.js b/build/hintrc.js index 851591ad..596aeafe 100644 --- a/build/hintrc.js +++ b/build/hintrc.js @@ -7,6 +7,7 @@ "define": true }, "strict": false, + "es3": true, // code style "bitwise": true, diff --git a/src/layer/tile/TileLayer.js b/src/layer/tile/TileLayer.js index 76e98326..f4885b4b 100644 --- a/src/layer/tile/TileLayer.js +++ b/src/layer/tile/TileLayer.js @@ -10,7 +10,7 @@ L.TileLayer = L.GridLayer.extend({ subdomains: 'abc', // errorTileUrl: '', - zoomOffset: 0, + zoomOffset: 0 /* maxNativeZoom: , @@ -53,8 +53,8 @@ L.TileLayer = L.GridLayer.extend({ createTile: function (coords, done) { var tile = document.createElement('img'); - tile.onload = L.bind(this._tileOnLoad, this, done); - tile.onerror = L.bind(this._tileOnError, this, done); + tile.onload = L.bind(this._tileOnLoad, this, done, tile); + tile.onerror = L.bind(this._tileOnError, this, done, tile); tile.src = this.getTileUrl(coords); @@ -70,16 +70,16 @@ L.TileLayer = L.GridLayer.extend({ }, this.options)); }, - _tileOnLoad: function (done, e) { - done(null, e.target); + _tileOnLoad: function (done, tile, e) { + done(null, tile); }, - _tileOnError: function (done, e) { + _tileOnError: function (done, tile, e) { var errorUrl = this.options.errorTileUrl; if (errorUrl) { - e.target.src = errorUrl; + tile.src = errorUrl; } - done(e, e.target); + done(e, tile); }, _getTileSize: function () {