From 20dddaa263f141a17719742876617016401f9af3 Mon Sep 17 00:00:00 2001 From: Stan Runge Date: Mon, 31 Aug 2026 14:38:02 +0000 Subject: [PATCH] dynamically import the maptiler api key --- src/routes/projects/animaldex/+page.svelte | 4 ++-- src/routes/projects/animaldex/register/+page.svelte | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/projects/animaldex/+page.svelte b/src/routes/projects/animaldex/+page.svelte index 14833f6..fd4d87a 100644 --- a/src/routes/projects/animaldex/+page.svelte +++ b/src/routes/projects/animaldex/+page.svelte @@ -55,9 +55,9 @@ onMount(async () => { const { Map, Marker, config } = await import('@maptiler/sdk'); - const { PUBLIC_MAPTILER_API_KEY } = await import('$env/static/public'); + const { env } = await import('$env/dynamic/public'); - config.apiKey = PUBLIC_MAPTILER_API_KEY; + config.apiKey = env.PUBLIC_MAPTILER_API_KEY; MapMarker = Marker; const initMap = (center: [number, number], zoom: number) => { diff --git a/src/routes/projects/animaldex/register/+page.svelte b/src/routes/projects/animaldex/register/+page.svelte index 7e8fbc8..14ee809 100644 --- a/src/routes/projects/animaldex/register/+page.svelte +++ b/src/routes/projects/animaldex/register/+page.svelte @@ -68,8 +68,8 @@ async function initMap() { if (!mapContainer || lat === null || lng === null) return; const { Map, Marker, config } = await import('@maptiler/sdk'); - const { PUBLIC_MAPTILER_API_KEY } = await import('$env/static/public'); - config.apiKey = PUBLIC_MAPTILER_API_KEY; + const { env } = await import('$env/dynamic/public'); + config.apiKey = env.PUBLIC_MAPTILER_API_KEY; map = new Map({ container: mapContainer,