commit 861f41392b01e6384707f20674745375fa63e6a9
parent d81572464c24eaf9e9b451b881e1114d1be3684a
Author: Sergey Orlov <wladimirych@gmail.com>
Date: Fri, 22 Jan 2021 09:38:22 +0100
TileLayer.cuntline: send proper object to callback
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/lib/leaflet.layer.TileLayer.cutline/index.js b/src/lib/leaflet.layer.TileLayer.cutline/index.js
@@ -101,12 +101,13 @@ L.TileLayer.include({
if (this._cutline && !this._cutline.approx && this.isCutlineIntersectingTile(coords, true)) {
const img = document.createElement('img');
img.crossOrigin = '';
- L.DomEvent.on(img, 'error', L.bind(this._tileOnError, this, done, img));
const tile = document.createElement('canvas');
tile.setAttribute('role', 'presentation');
L.DomEvent.on(img, 'load', L.bind(this._drawTileClippedByCutline, this, coords, img, tile, done));
+ L.DomEvent.on(img, 'error', L.bind(this._tileOnError, this, done, tile));
+
let url = this.getTileUrl(coords);
if (this.options.noCors) {
url = urlViaCorsProxy(url);