Saturday, 24 October 2015

sql - Link to another table in CartoDB infowindow



I have two layers in CartoDB, one with spatial data, school_count, and one without, heisman_winners. I want to visualize my spatial layer but when a user clicks on a feature I want it to display data from my non-spatial table. I have a common column between the two tables: 'school'. On my non-spatial tables I have multiple records that correspond to each 'school' (i.e. 'class', 'name', 'position', 'percentage', 'points', 'year'). Can I set a SQL query that runs when a user clicks a feature that will return each corresponding record from another table? So when they click it will look like this:


'name' , 'position', 'points', 'percentage', 'year', 'class'
'name' , 'position', 'points', 'percentage', 'year', 'class'
'name' , 'position', 'points', 'percentage', 'year', 'class'
etc...


I fond this block but I am not sure exactly how to tweak it correctly.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...