From 78d5a478e5b1c1bde6fd6021c1e672c5986308f6 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Sat, 13 Jul 2024 12:51:04 +0200 Subject: [PATCH] manual webgl2 check --- website/src/lib/components/Map.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/src/lib/components/Map.svelte b/website/src/lib/components/Map.svelte index a4c4e6f0..80b81481 100644 --- a/website/src/lib/components/Map.svelte +++ b/website/src/lib/components/Map.svelte @@ -21,6 +21,7 @@ mapboxgl.accessToken = accessToken; + let webgl2Supported = true; let fitBoundsOptions: mapboxgl.FitBoundsOptions = { maxZoom: 15, linear: true, @@ -34,7 +35,9 @@ }); onMount(() => { - if (!mapboxgl.supported()) { + let gl = document.createElement('canvas').getContext('webgl2'); + if (!gl) { + webgl2Supported = false; return; } @@ -145,7 +148,7 @@
- {#if mapboxgl.supported()} + {#if webgl2Supported}
{:else}