I want to add a time slider to a map. It looks as if I have to do that via CartoCSS but I really don't know where to start. Unfortunately, I don't understand what all the other posts regarding this issue say.

Does anyone know of a super basic tutorial on how to add a slider to a map?

  • Are you using BUILDER, CARTO.JS or CARTO VL? – ramiroaznar Jul 29 '18 at 21:10

The best tutorial about how to animate a point dataset in CARTO BUILDER is this guide. Bear in mind that Torque, the client-side Javascript library that BUILDER uses to aggregate and animate data temporarily, has some limitations:

  • Only point data is supported. If you have lines or polygons, you will need to convert them using something like ST_Centroid or ST_PointOnSurface, or a couple of BUILDER analysis such as selecting points in polygons or creating centroids from geometries.
  • Your dataset needs to have a date field. Numeric fields also work but selecting this type of column will not aggregate your data in temporal buckets such as months, days, years and so on. You can transform string/numeric fields into dates using to_timestamp function.
  • Only one Torque layer (heatmap, animated...) can be shown in a BUILDER map.

If your dataset already covers these points, as explained in the guide, you basically need to:

  1. Select your layer.
  2. Select ANIMATED in the aggregation carousel at the top of the STYLE tab.
  3. Select your date field.

After the 2nd point, BUILDER will automatically style your layer as animated and add a time series widget (aka time slider) to your map.

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.