yudaduy

Base Map Example

Sep 20th, 2021 (edited)
452
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <title>Base Map Google Maps Platform</title>
  5.     <style>
  6.         /* Always set the map height explicitly to define the size of the div
  7.        * element that contains the map. */
  8.         #map {
  9.         height: 100%;
  10.         }
  11.  
  12.         /* Optional: Makes the sample page fill the window. */
  13.         html,
  14.         body {
  15.         height: 100%;
  16.         margin: 0;
  17.         padding: 0;
  18.         }
  19.     </style>
  20.  
  21.     <!-- jsFiddle will insert css and js -->
  22.   </head>
  23.   <body>
  24.     <div id="map"></div>
  25.  
  26.     <!-- Async script executes immediately and must be after any DOM elements used in callback. -->
  27.     <script
  28.      src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&callback=initMap&v=weekly&channel=2"
  29.      async
  30.    ></script>
  31.  
  32.     <script>
  33.    
  34.       function initMap() {
  35.  
  36.       var map = new google.maps.Map(document.getElementById('map'), {
  37.       zoom: 3,
  38.       center: { lat: -28.024, lng: 140.887 },
  39.       });
  40.     }
  41.     </script>
  42.   </body>
  43. </html>
RAW Paste Data