Permalink
Browse files

Fix firing event inside promise callback

  • Loading branch information...
1 parent 8dedc74 commit a4c672c615baf31feeafaf728decc0c7b32b6a3a @ismyrnow committed Feb 2, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/leaflet.functionaltilelayer.js
@@ -49,9 +49,10 @@ L.TileLayer.Functional = L.TileLayer.extend({
});
} else if (typeof tileUrl.then === 'function') {
// Assume we are dealing with a promise.
+ var self = this;
tileUrl.then(function (tileUrl) {
tile.src = tileUrl;
- this.fire('tileloadstart', {
+ self.fire('tileloadstart', {
tile: tile,
url: tile.src
});

0 comments on commit a4c672c

Please sign in to comment.