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 mapbox.com map into a Visual Builder project.

Accepted answer
41
Views
5
Comments

Summary

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:https://development-idfig330webt-ia.integration.ocp.oraclecloud.com/e17e73df-1d18-44fe-9dff-81ecc05ae84c' 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.

Register

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