Skip to content

Instantly share code, notes, and snippets.

Forked from javisantana/index.html
Last active December 3, 2015 16:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Torque with a Custom Time Slider
<!DOCTYPE html>
<title>Easy example | CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="" />
html, body, #map {
height: 100%;
padding: 0;
margin: 0;
<link rel="stylesheet" href="" />
<div id="map"></div>
<script src=""></script>
function main() {
cartodb.createVis('map', '', {
shareable: true,
title: true,
description: true,
search: true,
tiles_loader: true,
center_lat: 0,
center_lon: 0,
zoom: 2
.done(function(vis, layers) {
var slider = vis.timeSlider;
slider.formatter(function(d) {
return "month:" + d.getUTCMonth();
.error(function(err) {
window.onload = main;
Copy link

csobier commented Dec 2, 2015

Updated CartoDB.js to latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment