fix: preserve camera annotation source resolution

This commit is contained in:
Redacted-Coder 2026-09-08 18:35:42 -04:00 committed by GitHub
parent 0d741449e2
commit c9ec6da894
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -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);