检测 WebGL 支持

尝试一下在线预览

启用了 WebGL 的浏览器是 GeoScene API for JavaScript 的一项要求。此示例演示了如何检测浏览器是否启用了 WebGL,以及如何为未启用 WebGL 的浏览器显示一条消息。

要测试此示例,请暂时关闭 WebGL:例如,在 Firefox 中,在 URL 栏中键入“about:config”,搜索“webgl.disabled”并将其变为 true

要测试您的浏览器是否启用了 WebGL,您可以尝试 get.webgl.org 或 webglreport.com

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.