0

copy paste from google instructions:

<!DOCTYPE html>
<html>
  <head>
    <title>Simple Map</title>
    <meta name="viewport" content="initial-scale=1.0">
    <meta charset="utf-8">
    <style>
      html, body {
        height: 100%;
        margin: 0;
        padding: 0;
      }
      #map {
        height: 100%;
      }
    </style>
  </head>
  <body>
    <div id="map"></div>
    <div id="capture"></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=AIzaSyC8kDz25qFYhy1UYiPyrzvcOpkiwZz9C4o&callback=initMap"
    async defer></script>
  </body>
</html>

and I'm still getting this error of google: "Oops! Something went wrong. This page didn't load Google Maps correctly. See the JavaScript console for technical details."

Why it's so complicated?

Here is my API Key

4
  • you are calling the function initMap before it was loaded in the google maps js file. Commented Jul 14, 2016 at 1:03
  • What does the javascript console say? Commented Jul 14, 2016 at 1:35
  • 2
    its wonderfull, in google example only height is set to 100%, when i set height and width in pixels its working, #map { height: 500px; width: 400px; } Commented Oct 5, 2018 at 17:10
  • @sairfan Thanks. I was banging my head. css was my issue. Commented Jun 24, 2021 at 22:41

1 Answer 1

2

It's simple. You did not activate the API key. I do not recall exactly where in the process this happens or how but it is one of the steps when you created the key.

Google Maps API error: ApiNotActivatedMapError

And included in the console message is the link to your instructions on what to do: https://developers.google.com/maps/documentation/javascript/error-messages#api-not-activated-map-error`

Sign up to request clarification or add additional context in comments.

2 Comments

so complicated, you know what.. I clicked on some button on google website, then that sent me back to the console API and I don't even know how I fixed it, but it's working now, thank you anyway
That is the activation button you clicked @NelsonDenver

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.