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,