1

With mapbox, I'm able to populate a JS array and draw a layer in realtime. I'm wondering if, once I pulled a map with createVis in cartodb, I can populate the infowindow with data per shape.

For example I'm pulling (from the PHP) the latest statistics per shape. And I draw/render the cartodb, and I want, on infowindow open, to show that information (so if I have shape id 60, I want corresponding statistics from my local mysql database). Is this possible? Or do I need to store all the data into cartodb and then redraw the map?

1 Answer 1

1

With CartoDB.js you can change the infowindow of any layer to meet your requirements, like having custom javascript on it to make further calls to CartoDB SQL API (example here).

2
  • But all data needs to come FROM cartodb's database right? SO I have to send data there, then redraw the map, rather than applying data directly to the map in real time. Feb 26, 2016 at 15:00
  • you can get the data wherever you want to, that example uses CartoDB SQL API but you can fetch data from any other source, it's pure javascript, up to you :) BUT if you need the data to drive your map, since it's rendered by CartoDB it needs to be stored on a table, of course.
    – Jorge Sanz
    Feb 26, 2016 at 15:58

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.