fixed cartocss updating for windshaft provider

This commit is contained in:
javi 2014-02-25 09:32:30 +01:00
parent 3db6aad219
commit 6eb7028a61
3 changed files with 8 additions and 1 deletions

View File

@ -252,6 +252,7 @@ GMapsTorqueLayer.prototype = _.extend({},
// provider options // provider options
var options = torque.common.TorqueLayer.optionsFromLayer(shader.findLayer({ name: 'Map' })); var options = torque.common.TorqueLayer.optionsFromLayer(shader.findLayer({ name: 'Map' }));
this.provider.setCartoCSS && this.provider.setCartoCSS(cartocss);
if(this.provider && this.provider.setOptions(options)) { if(this.provider && this.provider.setOptions(options)) {
this._reloadTiles(); this._reloadTiles();
} }

View File

@ -236,9 +236,11 @@ L.TorqueLayer = L.CanvasLayer.extend({
// provider options // provider options
var options = torque.common.TorqueLayer.optionsFromLayer(shader.findLayer({ name: 'Map' })); var options = torque.common.TorqueLayer.optionsFromLayer(shader.findLayer({ name: 'Map' }));
this.provider.setCartoCSS && this.provider.setCartoCSS(cartocss);
if(this.provider.setOptions(options)) { if(this.provider.setOptions(options)) {
this._reloadTiles(); this._reloadTiles();
} }
_.extend(this.options, options); _.extend(this.options, options);
// animator options // animator options

View File

@ -183,6 +183,10 @@
}; };
}, },
setCartoCSS: function(c) {
this.options.cartocss = c;
},
setOptions: function(opt) { setOptions: function(opt) {
var refresh = false; var refresh = false;
@ -354,7 +358,7 @@
"layers": [{ "layers": [{
"type": "torque", "type": "torque",
"options": { "options": {
"cartocss_version": "2.1.1", "cartocss_version": "1.0.0",
"cartocss": this.options.cartocss, "cartocss": this.options.cartocss,
"sql": this.getSQL() "sql": this.getSQL()
} }