Google Maps API Error: ApiNotActivatedMapError
I have created a below simple google maps api example and getting the above error in the console.
<!DOCTYPE html> <html> <head> <title>Add Map</title> <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap&libraries=&v=weekly" defer ></script> <link rel="stylesheet" type="text/css" href="./style.css" /> <script src="./index.js"></script> </head> <body> <h3>My Google Maps Demo</h3> <!--The div element for the map --> <div id="map"></div> </body> </html>
Since 22nd June 2018, Google has updated its business model. Each API has its own separate billing, and for that reason, each API must be enabled individually. To get Geocoding on Google Maps to work properly the following APIs need to be enabled.
- Geocoding Service.
- Directions Service.
- Distance Matrix Service.
- Elevation Service.
- Places Library.
You need to follow the below steps to enable the APIs:-
Step 1: Visit the following Google APIs & Services Console and click on the + ENABLE APIS AND SERVICES link as shown below:-
Step 2: You will be redirected to the API Library page as shown below:-