Fix torque cat wizard

The culprit turned out to be the cumulative option that was removed a
few days ago, the layer-type option must be present somewhere among the
form options for the expected layer changes to happen.
pull/1199/head
Nicklas Gummesson 10 years ago
parent e5cfc0338d
commit 4a6a0dcbb6

@ -583,20 +583,18 @@ cdb.admin.forms.density = {
polygon_comp_op
]
};
cdb.admin.forms.torque = {
var sharedForTorqueAndTorqueCat = {
'point': [
{
name: 'Cumulative',
form: {
'torque-cumulative': { type: 'switch', value: false },
'layer-type': { type: 'hidden' , value: 'torque' }
}
},
column_numeric_date_with_cartodb_id,
{
name: 'Marker type',
form: {
'marker-type': { type: 'select', value: 'ellipse', extra: ['ellipse', 'rectangle'] }
'marker-type': { type: 'select', value: 'ellipse', extra: ['ellipse', 'rectangle'] },
// this layer-type value must be present among the form options for the torque wizards to work as expected!
// see issue #1166 on github, for related bug report and discussion.
'layer-type': { type: 'hidden', value: 'torque' }
}
},
{
@ -651,14 +649,21 @@ cdb.admin.forms.torque = {
};
cdb.admin.forms.torque_cat = clone(cdb.admin.forms.torque);
cdb.admin.forms.torque = clone(sharedForTorqueAndTorqueCat);
// Prepend the cumulative option for torque form only.
cdb.admin.forms.torque['point'].unshift({
name: 'Cumulative',
form: {
'torque-cumulative': {type: 'switch', value: false}
}
});
cdb.admin.forms.torque_cat = clone(sharedForTorqueAndTorqueCat);
// insert category column after time column
cdb.admin.forms.torque_cat['point'].splice(2, 0, column_torque_category);
// remove cumulative option for torque category wizard
cdb.admin.forms.torque_cat['point'].splice(0, 1);
// change blend mode to not distort the colors
_.find(cdb.admin.forms.torque_cat['point'], function(o) { return o.name === 'Blend Mode' }).form['torque-blend-mode'].value = 'source-over';

Loading…
Cancel
Save