· 6 years ago · Nov 05, 2019, 06:30 PM
1!DOCTYPE html>
2<html>
3<head>
4 <style>
5 /* Set the size of the div element that contains the map */
6 #map {
7 margin: 0;
8 padding: 0;
9 height: 400px; /* The height is 400 pixels */
10 width: 100%; /* The width is the width of the web page */
11 }
12 </style>
13</head>
14<body>
15 <h3>Our office</h3>
16 <!--The div element for the map -->
17 <div id="map"></div>
18 <script>
19 // Initialize and add the map
20 function initMap() {
21 // The location of MovieOrMove
22 var MovieOrMove = { lat: 31.969824, lng: 34.771027 };
23 // The map, centered at MovieOrMove
24 var map = new google.maps.Map(
25 document.getElementById('map'), { zoom: 15, center: MovieOrMove });
26 // The marker, positioned at MovieOrMove
27 var marker = new google.maps.Marker({ position: MovieOrMove, map: map });
28 }
29 </script>
30 <!--Load the API from the specified URL
31 * The async attribute allows the browser to render the page while the API loads
32 * The key parameter will contain your own API key (which is not needed for this tutorial)
33 * The callback parameter executes the initMap() function
34 -->
35 <script async defer
36 src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCRk4xPUUAHS6G3hfQvt9eQRwscQgY-Vq8&callback=initMap">
37 </script>
38</body>
39</html>