Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ApiNotActivatedMapError for simple html page using google-places-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.

Here is my 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> 

but I get this error message- enter image description here

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

like image 903
Roy Avatar asked Feb 29 '16 12:02

Roy


People also ask

How do I use my Google places API key?

Go to the Google Maps Platform > Credentials page. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key. Click Close.

Can we use Google Location API for free?

The API is available for developers that have a free Google Maps API key. Usage of the API is not strictly free, but they do offer $200 of free monthly usage for most users. The pricing scales to fit your particular needs and you are only charged for your API usage.


2 Answers

To enable Api do this

  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.

OR You can try this url: Maps JavaScript API

Hope this will solve the problem of enabling API.

like image 125
Adi Avatar answered Oct 10 '22 21:10

Adi


Assuming you already have a application created under google developer console, Follow the below steps

  1. Go to the following link https://console.cloud.google.com/apis/dashboard? you will be getting the below page enter image description here
  2. Click on ENABLE APIS AND SERVICES you will be directed to following page enter image description here
  3. Select the desired option - in this case "Maps JavaScript API"
  4. Click ENABLE button as below, enter image description here

Note: Please use a server to load the html file

like image 41
Aravind Avatar answered Oct 10 '22 20:10

Aravind