Skip to content

[BUG] Google Maps key verifier requires unavailable Places API Legacy #386

Closed as not planned

Description

@alexl83

Describe the bug

The Google Maps API Key verifier calls the legacy Places Autocomplete endpoint:

https://maps.googleapis.com/maps/api/place/autocomplete/json

This makes WWV report a valid Map Tiles API key as invalid with an "API not activated" error when the Google Cloud project has Map Tiles API and Places API (New) enabled. New Google Cloud projects can no longer enable Places API (Legacy), so enabling the API requested by the error is not a viable fix.

The key is subsequently used by createGooglePhotorealistic3DTileset, so the verifier should probe the Map Tiles API capability that WWV actually requires.

To reproduce

  1. Create a new Google Cloud project with billing enabled.
  2. Enable Map Tiles API and Places API (New).
  3. Create an API key authorized for Map Tiles API.
  4. In local WWV, open API Keys → Service Keys.
  5. Enter the key under Google Maps API Key.
  6. Observe that verification fails because WWV calls Place Autocomplete (Legacy).

Expected behavior

WWV should validate the key against the Photorealistic 3D Tiles endpoint and surface the Map Tiles API error message when configuration, billing, regional availability, or key restrictions prevent access.

Proposed patch

diff --git a/src/app/api/keys/verify/route.ts b/src/app/api/keys/verify/route.ts
--- a/src/app/api/keys/verify/route.ts
+++ b/src/app/api/keys/verify/route.ts
@@
 async function verifyGoogleMaps(key: string): Promise<{ valid: boolean; error?: string }> {
-    // Use a minimal Places Autocomplete request as a probe
-    const url = `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=a&key=${encodeURIComponent(key)}`;
+    // Probe the API WWV actually uses for Google Photorealistic 3D Tiles.
+    // Places Autocomplete (Legacy) cannot be enabled on new Google Cloud
+    // projects and therefore rejects otherwise valid Map Tiles API keys.
+    const url = `https://tile.googleapis.com/v1/3dtiles/root.json?key=${encodeURIComponent(key)}`;
     const res = await fetch(url);
-    const data = await res.json();
-    if (data.status === "OK" || data.status === "ZERO_RESULTS") {
-        return { valid: true };
-    }
-    return { valid: false, error: data.error_message || data.status };
+    if (res.ok) return { valid: true };
+
+    const data = await res.json().catch(() => null) as {
+        error?: { message?: string; status?: string };
+    } | null;
+    return {
+        valid: false,
+        error: data?.error?.message || data?.error?.status || `Map Tiles API returned HTTP ${res.status}`,
+    };
 }

Environment

  • WWV local edition at commit f3d7e00
  • Native ARM64 Docker deployment on Raspberry Pi 5
  • Accessed over a LAN hostname

Google's current migration documentation distinguishes Autocomplete (New) from the legacy GET endpoint and states that Places API Legacy cannot be enabled for new projects.

Activity

  1. github-actions commented on Aug 1, 2026

    @github-actions
    Contributor

    Issue Classification

    Field Value
    Target Repo repo:web
    Type bug
    Confidence low
    Reasoning Keyword fallback (DeepSeek API unavailable)

    Classification used keyword fallback (DeepSeek API was unavailable).

    Low-confidence classification. A maintainer should verify and adjust labels as needed.

  2. github-actions commented on Oct 1, 2026

    @github-actions
    Contributor

    This issue has been inactive for 60 days. If there is no further activity in the next 14 days it will be closed automatically.

  3. github-actions commented on Oct 16, 2026

    @github-actions
    Contributor

    Closing due to inactivity. Feel free to re-open if the issue is still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrepo:webBelongs to worldwideview-webstalestatus:needs-triageNeeds initial triage

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions