Skip to content

withWorkerUrlHint

withWorkerUrlHint(message, version): string

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

maplibre-gl 6 locates its worker (maplibre-gl-worker.mjs) next to its own module URL. Served as-is (an import map, a CDN) that just works; inside a bundle the module URL is the bundle chunk’s, the worker is not there, and MapLibre reports “Worker failed to load”. MapLibre makes the bundler user call setWorkerUrl(); this appends that fix to the error a map surfaces, so ml-map:error says what to do instead of only what broke. Other messages, and every pre-6 runtime, pass through unchanged.

ParameterType
messagestring
versionstring | undefined

string