title: How to dynamically set zoom value on Google Maps API during initialization
body: <p>I have code like below.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;style type="text/css"&gt;
        html, body { height: 100%; margin: 0; padding: 0; }
        #map { height: 100%; }
      &lt;/style&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;input type="hidden" id="zoom_data" value="8"&gt;
      &lt;div id="map"&gt;&lt;/div&gt;
      &lt;script type="text/javascript"&gt;
  
  var map;
  function initMap() {
    map = new google.maps.Map(document.getElementById('map'), {
      center: {lat: -34.397, lng: 150.644},
      zoom: $('zoom_data').val()
    });
  }
  
      &lt;/script&gt;
      &lt;script async defer
        src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&amp;callback=initMap"&gt;
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>But the maps goes blank. I just want to dynamically set zoom locally, not from server. Any advice?</p>