可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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.
Here is my html-
test
but I get this error message- 
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
回答1:
To enable Api do this
- Go to
API Manager
- Click on
Overview
- Search for
Google Maps JavaScript API
(Under Google Maps APIs
). Click on that - You will find
Enable
button there. Click to enable API.
Hope this will solve the problem of enabling API.
回答2:
as of Jan 2017, unfortunately @Adi's answer, while it seems like it should work, does not. (Google's API key process is buggy)
you'll need to click "get a key" from this link: https://developers.google.com/maps/documentation/javascript/get-api-key
also I strongly recommend you don't ever choose "secure key" until you are ready to switch to production. I did http referrer restrictions on a key and afterwards was unable to get it working with localhost, even after disabling security for the key. I had to create a new key for it to work again.
回答3:
Have you tried following the advice on the linked help page? The help page at http://g.co/mapsJSApiErrors says:
ApiNotActivatedMapError
The Google Maps JavaScript API is not activated on your API project. You may need to enable the Google Maps JavaScript API under APIs in the Google Developers Console.
See Obtaining an API key.
So check that the key you are using has Google Maps JavaScript API enabled.
回答4:
I had the same error. To fix the error:
- Open the console menu
Gallery Menu
and select API Manager
. - On the left, click
Credentials
and then click New Credentials
. - Click
Create Credentials
. - Click
API KEY
. - Click
Navigator Key
(there are more options; It depends on when consumed).
You must use this new API Navigator Key
, generated by the system.