viewof map = {
const container = html`<div style="height:600px;">`;
yield container;
const icon = L.icon({
iconUrl:
"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.8.0/images/marker-icon.png"
});
const map = L.map(container).setView([33.99, -118.07], 12);
container.value = map;
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
attribution:
"© <a href=https://www.openstreetmap.org/copyright>OpenStreetMap</a> contributors"
}).addTo(map);
for (const stop of stops) {
L.marker([stop.latitude, stop.longitude], {
icon,
title: stop.description
}).addTo(map);
}
yield container;
}