Skip to content

setWorkerModuleUrl

setWorkerModuleUrl(url): boolean

Defined in: packages/core/src/renderer/maplibre-interop.ts:111

Point maplibre-gl 6+ at its worker module — the bundler setup MapLibre requires (see withWorkerUrlHint) — without forking on version.

Applies only when the running maplibre-gl is 6 or later, url is given, and nobody set a worker URL yet (a host’s own setWorkerUrl call wins). Before v6 it is a no-op: the v4/v5 bundle carries its worker inline, and their setWorkerUrl expects a classic-script URL, not this module.

ParameterTypeDescription
urlstring | undefinedthe bundler’s URL for maplibre-gl/dist/maplibre-gl-worker.mjs (Vite: import url from "maplibre-gl/dist/maplibre-gl-worker.mjs?worker&url")

boolean

whether the URL was applied