map = {
const container = yield htl.html`<div style="height: 700px;">`;
const map = L.map(container);
const layer = L.geoJSON(localGeoJSON, {
onEachFeature: (feature, layer) => {
layer.bindPopup( `
<h2>${feature.properties.CFSAUID} ${feature.properties.Neighbourhood}</h2>
<p>${feature.properties.Count} Licensed Cats in 2021</p>
`);
},
style: (feature) =>{
return{
stroke: 0,
fillColor: '#ff6600',
fillOpacity: feature.properties.Count / 550
}
}
}).addTo(map);
map.fitBounds(layer.getBounds(), {maxZoom: 10});
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "© <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors"
}).addTo(map);
}