torque/test/torque.js

29 lines
754 B
JavaScript
Raw Permalink Normal View History

2013-11-19 00:34:50 +08:00
module('torque');
test('gets metadata from cartocss', function() {
var STYLE = [
"Map { ",
" buffer-size: 1;",
" -torque-frame-count: 1;",
2013-11-19 00:34:50 +08:00
" -torque-resolution: 2;",
" -torque-animation-duration: 31;",
" -torque-aggregation-function: 'avg(cartodb_id)';",
" -torque-time-attribute: 'time';",
" -torque-data-aggregation: 'cumulative';",
"}",
"#layer { ",
" polygon-fill: #FFF;",
"}"
].join('\n');
2013-11-20 22:09:45 +08:00
var opts = torque.common.TorqueLayer.optionsFromCartoCSS(STYLE);
2013-11-19 00:34:50 +08:00
equal(opts['buffer-size'], 1);
equal(opts['steps'], 1);
equal(opts['resolution'], 2);
equal(opts['animationDuration'], 31);
equal(opts['countby'], 'avg(cartodb_id)');
equal(opts['column'],'time');
equal(opts['data_aggregation'], 'cumulative');
})