map = {
const container = html`<div style="height:600px;">`;
yield container;
const map = L.map(container).setView([38.04,-78.49], 13);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "© <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors"
}).addTo(map);
const values = Object.values(acsData[tenure].prop_no_vehicle);
const scale = chroma.scale(['yellow', '008ae5']).domain([Math.min(...values), Math.max(...values)]);
const onEachFeature = (feature, layer) => {
const propNoVehicle = acsData[tenure].prop_no_vehicle[feature.properties.GEOID10];
layer.bindTooltip(`Blockgroup ${feature.properties.GEOID10}: ${(propNoVehicle * 100).toFixed(2)}%`);
}
const geoJSONLayer = L.geoJSON(blockgroups, {
onEachFeature: onEachFeature,
style: (feature) => {
const propNoVehicle = acsData[tenure].prop_no_vehicle[feature.properties.GEOID10];
const color = scale(propNoVehicle);
return {
color: "black",
fillColor: color,
fillOpacity: 0.4,
weight: 1
};
}
}).addTo(map);
}