使用 google-places-api 的简单 html 页面的 ApiNotActivatedMapError [英] ApiNotActivatedMapError for simple html page using google-places-api
问题描述
我正在尝试创建一个包含 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
- 转到
API 管理器
- 点击
概览
- 搜索
Google Maps JavaScript API
(在Google Maps APIs
下).点击那个 - 您会在那里找到
Enable
按钮.单击以启用 API.
- Go to
API Manager
- Click on
Overview
- Search for
Google Maps JavaScript API
(UnderGoogle Maps APIs
). Click on that - 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屋!