From c9ec6da89491d84ff5b82fe22fbf34467a49f4da Mon Sep 17 00:00:00 2001 From: Redacted-Coder Date: Tue, 8 Sep 2026 18:35:42 -0400 Subject: [PATCH] fix: preserve camera annotation source resolution --- src/annotations/annotationResolver.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/annotations/annotationResolver.js b/src/annotations/annotationResolver.js index 3bcc143..d3d23e8 100644 --- a/src/annotations/annotationResolver.js +++ b/src/annotations/annotationResolver.js @@ -603,8 +603,12 @@ function ringAreaM2(ring) { * viewport so "the marina" resolves near where the user is looking. */ async function geocodePlace(query, biasRect, signal) { - const apiKey = window.__GOOGLE_MAPS_API_KEY__ || import.meta.env.GOOGLE_MAPS_API_KEY; - if (!apiKey) return null; + const apiKey = window.__GOOGLE_MAPS_API_KEY__ || import.meta.env?.GOOGLE_MAPS_API_KEY; + if (!apiKey || apiKey === 'your_google_maps_api_key_here') { + const { findFreePlace } = await import('../freeGeocode.js'); + const place = await findFreePlace(query, { signal }).catch(() => null); + return place ? { ...place, viewport: normalizeGeocodeViewport(place.viewport) } : null; + } const cacheKey = `${query.toLowerCase()}|${biasRect || ''}`; const cached = cacheRead(geocodeCache, cacheKey);