Skip to content

resolveBasemap

resolveBasemap(basemap, fetcher?): Promise<unknown>

Defined in: packages/core/src/emitter/basemap.ts:294

Resolve a basemap declaration to a style object.

ParameterTypeDefault value
basemapunknownundefined
fetcherBasemapFetcherdefaultFetcher

Promise<unknown>

A basemap may be given inline as an object, in which case there is nothing to resolve. A URL is fetched.

Failure is an error rather than a degradation, in both modes. Every other unrepresentable thing has a sane fallback — live data becomes a snapshot, chrome becomes absence — but a map with no basemap is not a degraded map, it is a blank screen. Emitting one silently would hand someone an artifact that looks like it worked.