I have to make a map of decreasing illiteracy rate in the last five years, I have data for each province. What I mean is that by the torque tool that offers cartodb, the provinces (which are polygons) will change color according to the index increases or decreases through time. anyone has an idea on how. Excuse my English is not my native language.


1 Answer 1


Torque is not capable of moving polygons at this point, but with CartoDB.js you can make these temporal changes to happen.

I always like two show two different approaches:

1: Reloading the layer by applying a new CartoCSS - My example available here is a big simplification, but you can have several CartoCSS codes prepared for different times and apply them accordingly by using timing functions in Javascript.

2: Using SQL to retrieve the new data (probably, the best approach): you can find an example here. It has a slider in which you can select the dates, and once this slider is moved CartoDB is retrieving only the data related to that period. You could reuse this functionality in order to show your data with polygons appear instead. By mixing this approach and the previous idea about using JS timing functions, you could make that each X seconds the date applied in the SQL changes, making your polygons appear accordingly to the information that you have for them in that data range.

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.