Problem with Google Maps KEY

Asked

Viewed 10,918 times

-1

I have a problem putting the Google Maps map on my site. I already generated a KEY in the dashboard and I got the simplest example from Google and it’s not working.

The error presented is:

"Oops! Something went wrong. This page did not load Google Maps correctly. Please refer to the Javascript console for details technicians."

What usually happens due to Key. However I have already managed MISCELLANEOUS and nothing.

Someone’s had that problem before?

I used the same Google example

<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
  <!-- jQuery library (served from Google) -->
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

    <style>
      /* Always set the map height explicitly to define the size of the div
       * element that contains the map. */
      #map {
        height: 100%;
      }
      /* Optional: Makes the sample page fill the window. */
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <div id="map"></div>
    <script>
      var map;
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          center: {lat: -34.397, lng: 150.644},
          zoom: 8
        });
      }
    </script>
    <script src="https://maps.googleapis.com/maps/api/js?key=KEYAQUI&callback=initMap"
    async defer></script>

  </body>
</html>

I put my key right there where there’s KEYHERE in the script

Thank you

  • Ha good, good. Let’s just delete the commies here so it doesn’t get too confusing

  • You need to associate your API with a billing account. For this you will need a valid credit card.

1 answer

3

  1. Crome panel, available at: https://console.developers.google.com > Bibliotecas >
  2. Search API: Google Maps Javascript API
  3. Activate the API

Browser other questions tagged

You are not signed in. Login or sign up in order to post.