google maps api javascript

JavaScript
 <!DOCTYPE html>
<html>
<body>

<h1>My First Google Map</h1>


  <div id="googleMap" style="width:100%;height:400px;"></div>

<script>

  function myMap() {
var mapProp= {
  center:new 
  google.maps.LatLng(51.508742,-0.120850),
  zoom:5,
};

  var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);

  }
</script>

<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&callback=myMap"></script>

  
</body>
</html>
 /*
Take look in below steps for integrate javascript google map api

We declare the application as HTML5 using the <!DOCTYPE html> declaration.
We create a div element named "map" to hold the map.
We define a JavaScript function that creates a map in the div.
We load the Maps JavaScript API using a script tag.
These steps are explained below.
*/
<!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: -34.397, lng: 150.644},
          zoom: 8
        });
      }
    </script>
    <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap"
    async defer></script>
  </body>
</html>

/*
I hope it will help you.
Namaste
Stay Home Stay Safe
*/
Source

Also in JavaScript: