Skip to content

galavi / resolveDataUrl

Function: resolveDataUrl()

resolveDataUrl(source, vars?): string

Defined in: utils/tile.ts:148

Resolve a Data source to a concrete URL.

If urlTemplate is set, substitutes {url} plus every key in vars (with values stringified). Otherwise falls back to url. Throws when neither is defined. The single substitution path used by tile fetchers, surface loaders, and shape loaders.

Parameters

source

Pick<Data, "url" | "urlTemplate">

vars?

Record<string, undefined | string | number>

Returns

string

Released under the GPL-3.0 License.