{
let parent = DOM.element('div', { style: `width:${width}px;height:${width/2}px` });
yield parent;
let map = L.map(parent).setView([42.3250, -71.0600], 11);
let osmTileLayer = L.tileLayer( 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>'
}).addTo( map );
let housingByGeoId = new Map(housingData.map(row => [row['GEO.id2'], row]));
let styleGenerator = feature => {
let style = {
"color": "rgb(100, 0, 0)",
"fillColor": colorScale(housingByGeoId.get(feature.properties.GEOID10).HD01_VD03),
"opacity": 1,
"weight": 1,
"fillOpacity": 0.3,
}
return style;
};
L.geoJSON(censusTracts, {style: styleGenerator}).addTo(map);
}