fix: resolve MapLibre worker rendering regression by configuring custom worker and updating geometry type filters
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import maplibregl from 'maplibre-gl';
|
||||
import workerUrl from 'maplibre-gl/dist/maplibre-gl-csp-worker.js?url';
|
||||
|
||||
// MapLibre 5 serializes its embedded worker from functions. Vite's class-field
|
||||
// transform injects __publicField outside those functions, leaving GeoJSON
|
||||
// workers with an undefined helper. Serve the matching standalone worker as an
|
||||
// untransformed asset in both development and production, before any map exists.
|
||||
maplibregl.setWorkerUrl(workerUrl);
|
||||
|
||||
export default maplibregl;
|
||||
Reference in New Issue
Block a user