Integrate a 3D MapBox map into my report
-
I am tryinf to integrate a 3D MapBox map into my report, but I am encountering some errors like :
Failed to initialize WebGL.
[.WebGL-0x2b8000329500]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels.
I am uncertain whether JSReport fully supports WebGL, and I would appreciate any insights or guidance regarding this matter. If anyone has successfully integrated 3D MapBox maps or has experience with WebGL-related issues in JSReport, I would be grateful for your input.
Here is my code exemple :
https://playground.jsreport.net/w/salaheddinelhamraoui/y3b~Y6lM
-
I see here a recommendation to add
preserveDrawingBuffer
option
https://github.com/mapbox/mapbox-gl-js/issues/7721#issuecomment-449511835Additionally, you need to enable the printing trigger to wait for rendering.
Then a map pops up.
-
I tried that, but I still get the same errors, with map box GL library
-
There are errors but the map seems to be displayed.
Do you actually need to use mapboxgl and can't you stick with mapbox? It seems to have broader support.jsreport uses headless chrome for html -> pdf conversion and doesn't tweek or interput this process.
If you want to find further troubleshooting, you can try to google something like
"headless chrome some error"You may find some hints to use some chromium switches. (like here.)This can be done in jsreport.config.json using
"extensions": { "chrome-pdf": { "launchOptions": { "args": ["--use-angle=swiftshader", "--use-gl=angle", "--in-process-gpu"] } } }
I actually get no errors when using these switches locally on Windows with the example.
The chromium version can be found in the profile logs. Currently its something like 117.
-
For anyone who has the same issue, It was related to GPU capacity, after I increased the GPU for our sever MapBox Gl worked with no issues.