leaflet-extras/leaflet-providers

preview in browser tabs

Opened this issue · 1 comments

I wanted to preview everything in a dedicated browser tab, that wasn't easy to do, came up with

// run on https://leaflet-extras.github.io/leaflet-providers/preview/
// then scroll to bottom of page, hold down CTRL and click 100 times.
[...document.querySelectorAll("[name=leaflet-base-layers]")].map((ele) => ele.parentNode.textContent.trim()).forEach(function(filterString) {
    let a = document.createElement("a");
    a.href = "#filter=" + encodeURIComponent(filterString);
    a.textContent = filterString;
    a.appendChild(document.createElement("br"));
    a.target = "_blank";
    a.addEventListener("click", () => a.parentNode.removeChild(a));
    document.body.appendChild(a);
});

Do you mean preview all overlays ? What do you mean by "then scroll to bottom of page, hold down CTRL and click 100 times" ? Is it a rant, a call for help, a enhancement idea ?