diff --git a/website/src/lib/components/Map.svelte b/website/src/lib/components/Map.svelte index cf146cfa..a4c4e6f0 100644 --- a/website/src/lib/components/Map.svelte +++ b/website/src/lib/components/Map.svelte @@ -7,9 +7,10 @@ import MapboxGeocoder from '@mapbox/mapbox-gl-geocoder'; import '@mapbox/mapbox-gl-geocoder/dist/mapbox-gl-geocoder.css'; + import { Button } from '$lib/components/ui/button'; import { map } from '$lib/stores'; import { settings } from '$lib/db'; - import { locale } from 'svelte-i18n'; + import { locale, _ } from 'svelte-i18n'; import { get } from 'svelte/store'; import { PUBLIC_MAPBOX_TOKEN } from '$env/static/public'; @@ -33,6 +34,10 @@ }); onMount(() => { + if (!mapboxgl.supported()) { + return; + } + let newMap = new mapboxgl.Map({ container: 'map', style: { version: 8, sources: {}, layers: [] }, @@ -140,7 +145,16 @@
-
+ {#if mapboxgl.supported()} +
+ {:else} +
+

{$_('webgl2_required')}

+ +
+ {/if}