map = {
const container = html`<div style="height:600px;">`;
let map = null
const attributionLayer = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution: "© <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors"
})
const reversedPivot = pivot.slice().reverse()
const pivotCircle = L.circle(reversedPivot)
const pivotMarker = L.marker(reversedPivot)
const redCircleIcon = L.icon({})
const targetMarkers = sortedDataset.map(d => L.marker([d.lat, d.long]))
container.update = function (radius) {
if(map) {
pivotCircle.setRadius(radius * 1000)
pivotCircle.addTo(map)
pivotMarker.addTo(map)
sortedDataset.forEach((d, i) => {
if (d.distance <= radius) {
targetMarkers[i].bindPopup(d.label).addTo(map)
} else {
targetMarkers[i].remove()
}
})
}
}
yield container;
map = L.map(container).setView(reversedPivot, 10)
attributionLayer.addTo(map)
}