1 var node = document.getElementById("pobreza-map");
2 d3.json("../data/barriosdata.json", function(data){
3 var pob_datamap = {};
4 data.forEach(function(barrio){
5 if(barrio.below_poverty != null){
6 // get tile id from metadata GEO_ID, last 5 chars from 19.
7 pob_datamap[barrio.geo_id.substring(14)] = barrio.below_poverty;
8 }
9 });
10 var pop_map = new AtlasPR({node: node, tiles: 'barrios', size: "large", on_ready: function(){
11 // this needs to be called after drawing the map.
12 pop_map.encode_quan(pob_datamap);
13 }});
14 });