sets cartocss once tiles have been loaded

This commit is contained in:
Francisco Dans 2016-07-04 18:50:00 +02:00
parent 0e9184e026
commit 2377029350

View File

@ -80,8 +80,10 @@ L.TorqueLayer = L.CanvasLayer.extend({
if (this.options.tileJSON) this.options.provider = 'tileJSON';
this.provider = new this.providers[this.options.provider](options);
options.layer = this;
this.renderer = new this.renderers[this.options.renderer](this.getCanvas(), options);
options.ready = function() {
self.fire("change:bounds", {
bounds: self.provider.getBounds()
@ -94,6 +96,10 @@ L.TorqueLayer = L.CanvasLayer.extend({
self.setKeys(self.getKeys());
};
this.on('tilesLoaded', function () {
self.renderer.setCartoCSS(self.renderer.style);
})
this.renderer.on("allIconsLoaded", this.render.bind(this));