You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Downgrading to v5.2.11 of react-map-gl was insufficient for my use case since I'm using Mapbox GL JS v2.x.x features (setTerrain() specifically)
For those out there in a similar spot, I was able to hack around things for the time being by adapting the suggestions in mapbox/mapbox-gl-js#10173:
Install worker-loader:
yarn add worker-loader
In your map component:
import ReactMapGL from "react-map-gl";
import mapboxgl from "mapbox-gl"; // This is a dependency of react-map-gl even if you didn't explicitly install it
// eslint-disable-next-line import/no-webpack-loader-syntax
mapboxgl.workerClass = require("worker-loader!mapbox-gl/dist/mapbox-gl-csp-worker").default;
I hope the Mapbox team can provide a long term solution soon.
Downgrading to v5.2.11 of
react-map-gl
was insufficient for my use case since I'm using Mapbox GL JS v2.x.x features (setTerrain()
specifically)For those out there in a similar spot, I was able to hack around things for the time being by adapting the suggestions in mapbox/mapbox-gl-js#10173:
Install
worker-loader
:In your map component:
I hope the Mapbox team can provide a long term solution soon.
Originally posted by @zanemountcastle in visgl/react-map-gl#1266 (comment)
The text was updated successfully, but these errors were encountered: