JSFiddle - React, Tailwind, and code Playground

by Mukesh Singh Negi

HTML

<!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;
      
      var latlng = {lat: 37.8768101, lng: -122.2813413}
      
      function initMap() {
        map = new google.maps.Map(document.getElementById('map'), {
          mapTypeId: google.maps.MapTypeId.SATELLITE,
          tilt: 0,
          center: latlng,
          zoom: 20
        });
        
        var mapZoomService = new google.maps.MaxZoomService()
        
        mapZoomService.getMaxZoomAtLatLng(latlng, function(MaxZoomResult){
            
            if(google.maps.MaxZoomStatus.OK){
                
                alert('map.getZoom(): '+map.getZoom()+', MaxZoomResult.zoom: ' + MaxZoomResult.zoom)
            }else{
                alert('Error: in google.maps.MaxZoomService().getMaxZoomAtLatLng()')
            }
        })
        
      }
    </script>
    <script src="https://maps.googleapis.com/maps/api/js?key=&callback=initMap"
    async defer></script>
  </body>
</html>