Problem Configuring Google Maps API

Asked

Viewed 86 times

0

Guys I can’t set up the Google Maps API, I’ve put my Keys and everything but it won’t.

<!DOCTYPE html>
<html>
   <head>
      <title>Simple Map</title>
      <meta name="viewport" content="initial-scale=1.0">
      <meta charset="utf-8">
      <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: -23.574423, lng: -46.623515},
                 zoom: 8
             });
         }
      </script>
      <script src="https://maps.googleapis.com/maps/api/js?key=KEY&callback=initMap"
                async defer></script>
   </body>
</html>
  • Matheus, some questions (they may be very naive). 1. You changed the word KEY by your key inside the import file? 2. Are you showing any errors in the console? (it might be a great ally to solve) 3. You have given access to any request (referring to platforms) within the GCP interface?

  • @I’m the one who changed the key for the word.

  • Ah, ok. I did not view the content of the edition. Thank you for warning.

  • And what’s the mistake?

No answers

Browser other questions tagged

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