gets options only Map part of cartocss

This commit is contained in:
Francisco Dans 2016-07-04 18:49:41 +02:00
parent 1ff54b9018
commit 0e9184e026

View File

@ -35,7 +35,8 @@ L.TorqueLayer = L.CanvasLayer.extend({
});
this.prevRenderedKey = 0;
if (options.cartocss) {
torque.extend(options, torque.common.TorqueLayer.optionsFromCartoCSS(options.cartocss));
var headerCartoCSS = options.cartocss.replace(/\n/g,'').match(/Map\s*?\{.*?}/g)[0];
torque.extend(options, torque.common.TorqueLayer.optionsFromCartoCSS(headerCartoCSS));
}
options.resolution = options.resolution || 2;