I'm using heatmaps in CartoDB and I would like to modify CartoCSS to reflect the value of a column. I have noticed this line in CartoCSS:

marker-fill-opacity: 0.1*[value];

I don't understand completely what [value] refers to but maybe there is a way to point to my column, something like:

marker-fill-opacity: 0.1*[my_column];

Is there something like this?


I assume that your code comes from a Torque map. In that scope, "value" is the variable that Torque uses to store the result of the aggregated data for each cell. Take a look at how spatial aggregation works for more information about how Torque works with the aggregation functions that you specify in the CartoCSS.

For the CartoCSS properties that accept expressions, you will be able to use something like 0.1*[my_column] and this will be evaluated for each point. Some CartoCSS properties do not accept expressions.

You can check which properties accept expressions in this CartoCSS documentation. marker-fill-opacity does not accept an expression, so you can't use your column name. It requires a float.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.