ApiNotActivatedMapError for simple html page using google-places-api

前端 未结 5 909
执念已碎
执念已碎 2020-12-07 11:30

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 stil

相关标签:
5条回答
  • 2020-12-07 11:52

    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.

    0 讨论(0)
  • 2020-12-07 12:03

    I had the same error. To fix the error:

    1. Open the console menu Gallery Menu and select API Manager.
    2. On the left, click Credentials and then click New Credentials.
    3. Click Create Credentials.
    4. Click API KEY.
    5. Click Navigator Key (there are more options; It depends on when consumed).

    You must use this new API Navigator Key, generated by the system.

    0 讨论(0)
  • 2020-12-07 12:07

    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
    2. Click on ENABLE APIS AND SERVICES you will be directed to following page
    3. Select the desired option - in this case "Maps JavaScript API"
    4. Click ENABLE button as below,

    Note: Please use a server to load the html file

    0 讨论(0)
  • 2020-12-07 12:09

    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.

    0 讨论(0)
  • 2020-12-07 12:19

    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.

    0 讨论(0)
提交回复
热议问题