You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

How to integrate map into a Visual Builder project.

Accepted answer


Trying to use Mapbox to display a map using the mapbox-gl.js. Everything works fine in Preview, but after deployment I see this error:

web_worker.js:9 Refused to create a worker from 'blob:' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'unsafe-inline' https:". Note that 'worker-src' was not explicitly set, so 'script-src' is used as a fallback.

Mapbox provides a solution for this CSP violation. They provide a mapbox-gl-csp.js file, and a mapbox-gl-csp-worker.js file. The worker file has to have the same origin as the calling page and is used like this:

Howdy, Stranger!

Log In

To view full details, sign in.


Don't have an account? Click here to get started!