使用 google-places-api 的简单 html 页面的 ApiNotActivatedMapError [英] ApiNotActivatedMapError for simple html page using google-places-api

查看:15
本文介绍了使用 google-places-api 的简单 html 页面的 ApiNotActivatedMapError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个包含 google-places-api 的简单 html 页面(我稍后想在那里添加一个自动完成输入).我有一个 api 密钥(已启用),但我仍然收到一条错误消息.

I'm trying to create a simple html page (I'd later like to add an autocomplete input there) that include google-places-api. I have an api-key (which is enabled) but I still get an error message.

这是我的 html-

<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=MY_KEY&libraries=places"></script>
    <title>test</title>
</head>
<body>
</body>

但我收到此错误消息-

在控制台中我得到 - Google Maps API 错误:Google Maps API 错误:ApiNotActivatedMapError

and in the console I get - Google Maps API error: Google Maps API error: ApiNotActivatedMapError

我不明白问题是什么..感谢任何人的帮助

I can't understand what the problem is.. Appreciate anybody's help

推荐答案

要启用 Api,请执行此操作

To enable Api do this

  1. 转到API 管理器
  2. 点击概览
  3. 搜索 Google Maps JavaScript API(在 Google Maps APIs 下).点击那个
  4. 您会在那里找到 Enable 按钮.单击以启用 API.
  1. Go to API Manager
  2. Click on Overview
  3. Search for Google Maps JavaScript API(Under Google Maps APIs). Click on that
  4. You will find Enable button there. Click to enable API.

你可以试试这个网址:Maps JavaScript API

希望这能解决启用 API 的问题.

Hope this will solve the problem of enabling API.

这篇关于使用 google-places-api 的简单 html 页面的 ApiNotActivatedMapError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆