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

asked May 18, 2015 at 12:15

1 Answer 1

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.

answered May 18, 2015 at 12:55
6
  • 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: Commented May 18, 2015 at 13:49
  • Uncaught TypeError: a.slider is not a function ---- and ---- Uncaught TypeError: this.$(...).slider is not a function Commented May 18, 2015 at 13:50
  • Hmmm, not sure the cause of that. Animations are supported. Are you doing anything programmatically to access the slider? Commented May 18, 2015 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. Commented May 18, 2015 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. Commented May 19, 2015 at 7:43

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.