WebGL and MapTiler Cloud maps
This article describes the relation between WebGL and the maps in MapTiler Cloud. It explains why the support of WebGL in a browser is necessary and how to troubleshoot eventual problems with the WebGL implementation.
What is WebGL
WebGL (Short for Web Graphics Library) is a JavaScript API for rendering interactive 2D and 3D graphics within any compatible web browser without the use of plug-ins. WebGL is fully integrated with other web standards, allowing GPU-accelerated usage of physics and image processing and effects as part of the web page canvas. WebGL elements can be mixed with other HTML elements and composited with other parts of the page or page background.
WebGL programs consist of control code written in JavaScript and shader code that is written in OpenGL ES Shading Language (GLSL ES), a language similar to C or C++, and is executed on a computer’s graphics processing unit (GPU). WebGL is designed and maintained by the non-profit Khronos Group. On February 9, 2022, Khronos Group announced WebGL 2.0 support for all major browsers.
What happens when WebGL is missing
In case your web browser is missing the WebGL, you might see an error message like this one:
If that happens (especially in the Mozilla Firefox browser),
go to the following page and try to detect the WebGL rendering feature:
https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/By_example/Detect_WebGL
Once you confirm your browser misses the WebGL component, you can use the following steps to troubleshoot. Or just install the WebGL from the web, the link is in the “Useful links” section.
Troubleshooting WebGL in the Mozilla Firefox browser
- Open about:config
- Search for webgl.force-enabled, set to true (default is false, WebGL should be auto-enabled)
- Search for webgl.disabled, set to false (default is false)
- Restart Firefox
It might sometimes be the case that the computer requires a graphics driver update or needs a reboot to finish the graphics driver installation. Sometimes WebGL in Firefox will become disabled after a driver update. Using webgl.force-enabled ignores the graphics driver update, if any, and forces it to run anyway.
Useful links
Related guides
- Automatically created API key
- Check if MapLibre GL JS is supported
- Coordinates API
- Dataset upload - formats and limits
- Difference between 256x256, 512x512, and HiDPI/Retina rasterized tiles
- Exported Tiles Multiplier
- Generalization in maps
- How are the tile requests cached in web browser?
- How MapTiler map tiles are Generated and Delivered
- How to add Geocoding control to Maplibre GL JS map