Search code examples
gmaps.js

Map not showing - gmaps.js - API is required


I use gmaps.js to show a Maps with Google Maps.

new GMaps({
  div: '#map',
  lat: -12.043333,
  lng: -77.028333
});

Now the map is not showing and in the console i get the following message:

"Google Maps API is required. Please register the following JavaScript library https://maps.googleapis.com/maps/api/js.

I tried to do something created a Key in the Google API Console but dont know what and where to put the key i got in the code?


Solution

  • I have simple sample for Google maps, hope it helps
    Just before closing BODY tag, insert this

     <script async defer
        src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE&signed_in=true&callback=initMap">