You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何移除Google Maps JavaScript API Alpha版开发提示横幅

解决Google Maps 3D实景地图的开发提示横幅问题

你看到的Using the alpha channel of the Google Maps JavaScript API. For development purposes only.横幅,是因为当前调用的是Google Maps JavaScript API的alpha测试版本——这个版本专为开发测试场景设计,无论是否完成计费配置和API密钥设置,都会强制显示该提示。

直接解决方法:切换到稳定版API

修改加载API时的版本参数,把v: "alpha"替换为稳定版标识(比如"weekly",即每周更新的稳定分支),或者直接移除该参数(默认加载最新稳定版):

修改后的API加载代码示例:

(g => { var h, a, k, p = "The Google Maps JavaScript API", c = "google", l = "importLibrary", q = "__ib__", m = document, b = window; b = b[c] || (b[c] = {}); var d = b.maps || (b.maps = {}), r = new Set, e = new URLSearchParams, u = () => h || (h = new Promise(async (f, n) => { await (a = m.createElement("script")); e.set("libraries", [...r] + ""); for (k in g) e.set(k.replace(/[A-Z]/g, t => "_" + t[0].toLowerCase()), g[k]); e.set("callback", c + ".maps." + q); a.src = `https://maps.${c}apis.com/maps/api/js?` + e; d[q] = f; a.onerror = () => h = n(Error(p + " could not load.")); a.nonce = m.querySelector("script[nonce]")?.nonce || ""; m.head.append(a) })); d[l] ? console.warn(p + " only loads once. Ignoring:", g) : d[l] = (f, ...n) => r.add(f) && u().then(() => d[l](f, ...n)) })({
    key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    // 将alpha替换为weekly,或直接删除此行
    v: "weekly",
});

额外说明

  • alpha版本包含未经过充分验证的新特性,仅适合功能测试,不建议用于生产环境的高尔夫球场3D地图项目;如果你的需求依赖alpha版独有的功能,暂时无法移除横幅,需等待该功能推送到稳定分支后再切换版本。
  • 切换版本后,确认API密钥已正确关联计费账户,且maps3d库已在Google Cloud控制台中启用,避免出现权限相关的加载问题。

内容的提问来源于stack exchange,提问作者Roger Urbina

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 20:53:14