Skip to content

Instantly share code, notes, and snippets.

@matallo
Created May 31, 2015 11:46
Show Gist options
  • Save matallo/e0c44ec9e4e5a6b54228 to your computer and use it in GitHub Desktop.
Save matallo/e0c44ec9e4e5a6b54228 to your computer and use it in GitHub Desktop.
for(var i = 0; i < vizjson.layers.length; ++i) {
var torqueIndex;
if (vizjson.layers[i].type === 'torque') {
torqueIndex = i;
createTorqueLayer(torqueIndex, attempt++);
} else {
cartodb.createLayer(self.map, vizjson, { layerIndex: i })
.done(function(layer) {
self.map.addLayer(layer);
createTorqueLayer(torqueIndex, attempt++);
}).on('error', function(err) {
console.log("some error occurred: " + err);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment