Compare commits

...

2 Commits

Author SHA1 Message Date
f94d68f539 Merge pull request 'dynamically import the maptiler api key' (#8) from dev into staging
All checks were successful
build / build (push) Successful in 46s
build / deploy (push) Successful in 13s
Reviewed-on: #8
2026-08-31 14:38:24 +00:00
20dddaa263 dynamically import the maptiler api key 2026-08-31 14:38:02 +00:00
2 changed files with 4 additions and 4 deletions

View File

@@ -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) => {

View File

@@ -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,