我想在应用程序内使用 Google Maps Tile 服务器 URL。
我正在使用该网址
https://mt0.google.com/vt/lyrs=s&hl=en&x={x}&y={y}&z={z}&s=Ga
,并且运行良好。问题是我不确定如何使用此网址的 Google Cloud API 密钥。
我尝试在 URL 末尾添加 API 密钥:但我在 Google 云控制台中
https://mt0.google.com/vt/lyrs=s&hl=en&x={x}&y={y}&z={z}&s=Ga&key=[MY_KEY]
没有看到“ Maps JavaScript API ”上的任何活动。这意味着 API 密钥未被使用。
此 URL 需要 API 密钥吗?
目前无需Key也可以使用,但恐怕从长远来看可能无法使用,或者在没有Key的情况下使用它可能是非法的。
我从这里发现有一个Google Maps Tile API(官方文档在这里)。但是,我似乎找不到启用此 API 的方法。
除了上面提到的问题中找到的链接之外,我在任何地方都找不到对此 API 的任何其他引用。它甚至没有列在Maps API 的主页(此处)或文档页面上。
该 API 也未在开发者控制台 API 库中列出。
我尝试发送会话请求(如文档中所述)但收到以下响应:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Maps Tile API has not been used in project XXXXXXXXXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/tile.googleapis.com/overview?project=XXXXXXXXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems …Run Code Online (Sandbox Code Playgroud) google-maps google-api google-maps-api-3 google-map-tiles-api