carto-vl
carto-vl copied to clipboard
CVL 1.4.1 regression :: filtering with list does not work anymore
What is happening :
Filtering viz by passing a filter: $cartodb_id in list([1,2,3,4,5])
send an error as follow :
this.viz_highlight.filter.blendTo(s.in(s.prop('id'), s.list(ids)));
equivalent to :
filter: $cartodb_id in list([1,2,3,4,5])
or
filter: $cartodb_id in list[1,2,3,4,5]
How to reproduce :
Just change the CVL version from 1.0.0 to 1.4.1 in the CDN of the example below:
https://jsfiddle.net/captainOski/g72weh0y/1/
Thank you for the good work !
Just got same error, for the moment I'm dynamically creating an 'or' concatenation for each value, something like:
const floorsString = `and (${floors.includes('0') && `$floor == 0 or` || ''} ${floors.includes('1') && ` $floor == 1 or` || ''} ${floors.includes('2') && ` $floor == 2 or` || ''}`;
setFloorsFilter(`${floorsString.substr(0, floorsString.lastIndexOf('or'))})`);