Render errorTile only when showLimitErrors is true

This commit is contained in:
rubenmoya 2017-11-15 15:14:42 +01:00
parent 73d1b1a9b5
commit b597fba4ae
2 changed files with 6 additions and 2 deletions

View File

@ -79,6 +79,8 @@ L.TorqueLayer = L.CanvasLayer.extend({
if (this.options.tileJSON) this.options.provider = 'tileJSON';
this.showLimitErrors = options.showLimitErrors;
this.provider = new this.providers[this.options.provider](options);
options.layer = this;
this.renderer = new this.renderers[this.options.renderer](this.getCanvas(), options);

View File

@ -297,8 +297,10 @@ var CartoDatasource = require('./datasource');
},
_renderErrorTile: function(tile) {
var img = this._icons[ERROR_IMG_URL];
img && this._ctx.drawImage(img, 0, 0, this.TILE_SIZE, this.TILE_SIZE);
if(this.layer.showLimitErrors) {
var img = this._icons[ERROR_IMG_URL];
img && this._ctx.drawImage(img, 0, 0, this.TILE_SIZE, this.TILE_SIZE);
}
},
//