gha890826

simpleMap

Mar 10th, 2021 (edited)
794
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.10 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <title>Simple Map</title>
  5.     <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
  6.     <style type="text/css">
  7.       /* Always set the map height explicitly to define the size of the div
  8.        * element that contains the map. */
  9.       #map {
  10.         height: 100%;
  11.       }
  12.  
  13.       /* Optional: Makes the sample page fill the window. */
  14.       html,
  15.       body {
  16.         height: 100%;
  17.         margin: 0;
  18.         padding: 0;
  19.       }
  20.     </style>
  21.     <script>
  22.       let map;
  23.  
  24.       function initMap() {
  25.         var myLatlng = new google.maps.LatLng(25.149888,121.776568);
  26.         map = new google.maps.Map(document.getElementById("map"), {
  27.           center: myLatlng,
  28.           zoom: 15,
  29.         });
  30.       }
  31.     </script>
  32.   </head>
  33.   <body>
  34.     <div id="map"></div>
  35.  
  36.     <!-- Async script executes immediately and must be after any DOM elements used in callback. -->
  37.     <script
  38.      src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY&callback=initMap&libraries=&v=weekly"
  39.      async
  40.    ></script>
  41.   </body>
  42. </html>
Add Comment
Please, Sign In to add comment