map = {
const container = yield htl.html`<div style="height: 500px;">`;
const map = L.map(container).setView([34.35, -58.423], 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 colorScale = d3.scaleOrdinal()
.domain([1, 2, 3, 4, 5])
.range(["#d73027", "#fc8d59", "#fee08b", "#91cf60", "#1a9850"]);
for (const d of data) {
const puntaje = +d.respuesta;
if (!puntaje || puntaje < 1 || puntaje > 5) continue;
const circle = L.circleMarker([d.lat, d.lng], {
radius: 8,
fillColor: colorScale(puntaje),
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 0.7
})
.bindPopup(`Puntaje: ${puntaje}`)
.addTo(map);
}
}