mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Add feature checks
This commit is contained in:
parent
ae6ec2959c
commit
112dcb2a2e
15
web/index.ts
15
web/index.ts
@ -15,6 +15,21 @@ const isWebGLSupported = () => {
|
||||
}
|
||||
|
||||
const start = async () => {
|
||||
if (!isSecureContext) {
|
||||
let message = "isSecureContext is false!";
|
||||
console.error(message)
|
||||
alert(message)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!crossOriginIsolated) {
|
||||
let message = "crossOriginIsolated is false! " +
|
||||
"The Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy HTTP headers are required.";
|
||||
console.error(message)
|
||||
alert(message)
|
||||
return;
|
||||
}
|
||||
|
||||
if (WEBGL) {
|
||||
if (!isWebGLSupported()) {
|
||||
console.error("WebGL is not supported in this Browser!")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user