Resolve every url-referencing source in a style into an inlined, self-contained one.
This is the asynchronous half of the API: osm() and satellite() build a style with
no I/O, and this fetches whatever those styles left as a reference. It is orthogonal to
style building — it works on any style, including guessStyle() output and hand-written
documents.
Use it when the style must stand on its own: published style.json artifacts, offline
or air-gapped deployments, and anywhere the first tile request should not wait for a
TileJSON round-trip. It is also the only place that can set the two properties MapLibre
cannot infer from a TileJSON — raster tileSize and raster-dem encoding.
Every fetched document is checked before it is inlined: it must be a valid TileJSON, and it must
describe the kind of tiles the source claims — a type: "vector" source needs a TileJSON with
vector_layers, a raster or raster-dem source one without. A url pointing at the wrong tileset
fails here, naming the offending source, rather than turning into an empty map later.
Returns a new style; the input is not mutated. Sources without a url are left alone.
Resolve every
url-referencing source in a style into an inlined, self-contained one.This is the asynchronous half of the API:
osm()andsatellite()build a style with no I/O, and this fetches whatever those styles left as a reference. It is orthogonal to style building — it works on any style, includingguessStyle()output and hand-written documents.Use it when the style must stand on its own: published
style.jsonartifacts, offline or air-gapped deployments, and anywhere the first tile request should not wait for a TileJSON round-trip. It is also the only place that can set the two properties MapLibre cannot infer from a TileJSON — rastertileSizeand raster-demencoding.Every fetched document is checked before it is inlined: it must be a valid TileJSON, and it must describe the kind of tiles the source claims — a
type: "vector"source needs a TileJSON withvector_layers, a raster or raster-dem source one without. Aurlpointing at the wrong tileset fails here, naming the offending source, rather than turning into an empty map later.Returns a new style; the input is not mutated. Sources without a
urlare left alone.