Configured eligible layers with opaque IDs and revisions.
Optionalrequest: (url: string, signal?: AbortSignal) => Promise<Blob>
Optional authenticated WMS request callback; defaults to fetch.
Browser-only pixel provider; matching itself can also run in Node.
Acquisition rejects with SOURCE when the selection names unknown,
several or non-WMS layers, or for transport/decoding failures, and with
BUDGET when the selection exceeds the WMS provider's pixel limits.
map.addSource("ortho", {
type: "raster",
tileSize: 256,
tiles: [
"https://example.org/wms?service=WMS&request=GetMap&version=1.3.0" +
"&layers=ortho&styles=&format=image/png&crs=EPSG:3857" +
"&width=256&height=256&bbox={bbox-epsg-3857}",
],
});
map.addLayer({ id: "ortho", type: "raster", source: "ortho" });
const provider = createMapLibreProvider([
{ id: "ortho", map, layer: "ortho", revision: "2026" },
]);
const reference = await provider.acquire(mapLibreSelection(map, ["ortho"]));
Create a provider for one WMS-backed MapLibre raster layer.
Requests use the endpoint and WMS parameters of the source's tile URL (layers, styles, version, time, filters and vendor parameters) with the selected extent, CRS and resolution, so the reference never depends on the rendered tiles. The layer may be hidden; its style must be loaded.