1

I'm trying to load a heatmap layer using cartodb.js, but it is failing whether I use createVis or the manual way.

Using createVis:

cartodb.createVis('mapDIV', 'https://PATH/viz.json');


Building a Leaflet map and then adding it:

var layerUrl = 'https://PATH/viz.json';
var cartoDB_lyr = cartodb.createLayer(map, layerUrl)
cartoDB_lyr.addTo(map);


Either way I am getting the following error message:

enter image description here

I am not sure how to debug this.

If I disable torque in CartoDB (i.e. visualizing the dataset as simple), then the dataset displays without a problem, so it must be specifically related to the heatmap:

enter image description here

1

Heatmaps were added in a more recent version of CartoDB.js than 3.11, the library that you're using. Upgrading to the most recent, 3.14, should fix your problem.

The library and associated CSS file follow the following format: http://libs.cartocdn.com/cartodb.js/v3/3.14/cartodb.js http://libs.cartocdn.com/cartodb.js/v3/3.14/themes/css/cartodb.css

Where the version number is explicit.

  • That did it! The tutorials I am using are still using version 3.11. Glad I asked! However, if I animate the heatmap I am still getting an error. Are animations perhaps not supported? Here are the errors: – BritishSteel May 18 '15 at 13:49
  • Uncaught TypeError: a.slider is not a function ---- and ---- Uncaught TypeError: this.$(...).slider is not a function – BritishSteel May 18 '15 at 13:50
  • Hmmm, not sure the cause of that. Animations are supported. Are you doing anything programmatically to access the slider? – Andy Eschbacher May 18 '15 at 14:34
  • btw, what tutorial were you working from? i just did a pull request to updated all academy.cartodb.com lessons with the newest library. – Andy Eschbacher May 18 '15 at 14:37
  • Yep, it was the Academy one: academy.cartodb.com/courses/03-cartodbjs-ground-up/… On that page it refers to <script src="libs.cartocdn.com/cartodb.js/v3/cartodb.js"></script>, which is not 3.14. – BritishSteel May 19 '15 at 7:43

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.