Make maplibregl ready to use with this SDK, whatever the major version and bundler. Idempotent, and a no-op on maplibre-gl v5 (its worker is inlined).
maplibregl
The maplibre-gl namespace (import * as maplibregl from 'maplibre-gl').
import * as maplibregl from 'maplibre-gl'
Optional explicit workerUrl / failure mode; see PrepareMapLibreOptions.
workerUrl
Error when the v6 worker cannot be resolved and onUnresolved is 'throw' (the default).
onUnresolved
'throw'
await prepareMapLibre(maplibregl);const map = new maplibregl.Map({ container: 'map', style }); Copy
await prepareMapLibre(maplibregl);const map = new maplibregl.Map({ container: 'map', style });
Make
maplibreglready to use with this SDK, whatever the major version and bundler. Idempotent, and a no-op on maplibre-gl v5 (its worker is inlined).