1

Is there a way to use a CartoDB torque chart such that the chart does not automatically play upon page load?

1

You can stop or pause the Torque jayer, but this requires using CartoDB.js. You can see the example here. Copying the code below for the record:

 <body>
<div id="map"></div>

<!-- include cartodb.js library -->
<script src="http://libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script>

<script>
  function main() {

    var torqueLayer;
    cartodb.createVis('map', 'VIZ_JSON_URL', {
        shareable: true,
        title: true,
        description: true,
        search: true,
        tiles_loader: true
    })
    .done(function(vis, layers) {
      //First layer is the basemap, the second is the Torque layer
      torqueLayer = layers[1];
      torqueLayer.pause();
    })
    .error(function(err) {
      console.log(err);
    });
  }

  window.onload = main;
</script>

| 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.