map = {
const container = html`<div style="height:400px;">`;
yield container;
const map = L.map(container).setView([51.49, 0], 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);
const vg = new VirtualGrid();
vg.addTo(map);
vg.on("cellcreate", function(e) {
L.rectangle([e.bounds.getSouthWest(), e.bounds.getNorthEast()], {
fill: false
}).addTo(map);
});
vg.on("cellenter", function(e) {
console.log(e.type, e);
});
vg.on("cellleave", function(e) {
console.log(e.type, e);
});
}