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.
    0_1702986014507_Screenshot 2023-12-19 at 12.39.26.png

    [.WebGL-0x2b8000329500]GL Driver Message (OpenGL, Performance, GL_CLOSE_PATH_NV, High): GPU stall due to ReadPixels.
    0_1702986026714_Screenshot 2023-12-19 at 12.39.38.png

    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-449511835

    Additionally, you need to enable the printing trigger to wait for rendering.
    Then a map pops up.
    0_1702987213473_upload-9ad057e0-a24d-4869-af53-f67823d47e33



  • 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.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.