Skip to content

Commit

Permalink
Merge pull request #72 from perliedman/fix-no-canvas-handling
Browse files Browse the repository at this point in the history
Actually break out when no canvas exist in click handler
  • Loading branch information
hallahan committed Sep 30, 2016
2 parents dbbdd8b + 66824a2 commit f74f895
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/MVTLayer.js
Expand Up @@ -293,7 +293,11 @@ module.exports = L.TileLayer.Canvas.extend({
var tileID = evt.tileID.split(":").slice(1, 3).join(":");
var zoom = evt.tileID.split(":")[0];
var canvas = this._tiles[tileID];
if(!canvas) (cb(evt)); //break out
if(!canvas) {
//break out
cb(evt);
return;
}
var x = evt.layerPoint.x - canvas._leaflet_pos.x;
var y = evt.layerPoint.y - canvas._leaflet_pos.y;

Expand Down

0 comments on commit f74f895

Please sign in to comment.