jeudi 30 juin 2016

Google Maps JavaScript API does not display


I need help to display Google Maps Javascript API.
When I try it, I have this message :
"Oops ... an error occurred. Google Maps does not load correctly on this page. For more technical information about this error, see the JavaScript console."

And when I look on Javascript console, I see :
"Fullscreen API prefix is obsolete. Please use the non-prefixed version of the API for full screen. For more information, see https://developer.mozilla.org/docs/Web/API/Fullscreen_API".

You can test this :

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

Thanks a lot ! :)


Aucun commentaire:

Enregistrer un commentaire