diff --git a/index.html b/index.html index 1e83bc8..f9afb06 100644 --- a/index.html +++ b/index.html @@ -56,9 +56,43 @@
LRTP 2040 Households: ${d3.format(',')(projectedData.lrtp_HH40)}
+ `) + .setMaxWidth('300px') + .addTo(map); + }else { const tazData = clickedData.find(item => item.properties['tabular_Total Population'] != null).properties; new mapboxgl.Popup() .setLngLat(e.lngLat) @@ -160,6 +170,7 @@ document.querySelector('.layers').addEventListener('click', (e) => { map.setLayoutProperty('taz', 'visibility', 'none'); map.setLayoutProperty('focus-area', 'visibility', 'none'); map.setLayoutProperty('focus-area-buffer', 'visibility', 'none'); + map.setLayoutProperty('2040-blocks', 'visibility', 'none'); break; case 'focus-area': toggleLayer('focus-area'); @@ -364,6 +375,41 @@ document.querySelector('.layers').addEventListener('click', (e) => { zeroColor ]) break; + + case 'lrtp_hh': + choroplethLegend.style.display = "inline"; + map.setLayoutProperty('2040-blocks', 'visibility', 'visible'); + map.setPaintProperty('2040-blocks', 'fill-color', ["step", + ['get', 'lrtp_HH40'], + zeroColor, 1, // 5 + colors[0], 6, // 25 + colors[1], 26, // 50 + colors[2], 51, // 100 + colors[3], 101, + colors[4] + ]); + break; + + case 'lrtp_emp': + choroplethLegend.style.display = "inline"; + map.setLayoutProperty('2040-blocks', 'visibility', 'visible'); + break; + case 'feir_hh': + choroplethLegend.style.display = "inline"; + map.setLayoutProperty('2040-blocks', 'visibility', 'visible'); + break; + case 'feir_emp': + choroplethLegend.style.display = "inline"; + map.setLayoutProperty('2040-blocks', 'visibility', 'visible'); + break; + case 'fmax_hh': + choroplethLegend.style.display = "inline"; + map.setLayoutProperty('2040-blocks', 'visibility', 'visible'); + break; + case 'fmax_emp': + choroplethLegend.style.display = "inline"; + map.setLayoutProperty('2040-blocks', 'visibility', 'visible'); + break; } }); diff --git a/style.css b/style.css index 2fff37e..d7002f4 100644 --- a/style.css +++ b/style.css @@ -23,6 +23,7 @@ p { .sidebar { background: rgba(255, 255, 255, .5); width: 300px; + overflow-y: scroll; } .layers {