title: iframe embedded google map zoom level resetting on page load
body: <p>I have a WordPress site running the Divi theme. I have a map embedded in an iframe with a zoom level set to 2.</p>
  <pre><code>&lt;iframe id=&quot;map_frame&quot; height=&quot;550&quot;&gt;&lt;/iframe&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
  $(&quot;#map_frame&quot;).attr(&quot;src&quot;, &quot;https://www.google.com/maps/d/embed?mid=1Sdu3m4-YMx_Kc0gWshTNQQgSFys&amp;z=2&quot;);
  &lt;/script&gt;
  </code></pre>
  <p>However, something seems to be resetting the zoom level after the map is loaded. In Firefox or Chrome, if the map loads off screen, after I scroll down to the map, the zoom level will reset to 1. If I scroll to the map and reload the page so that the map loads immediately on page load, the zoom level is set correctly. In Safari, the zoom will reset to 1 regardless of whether it loads off screen or not.</p>
  <p>Even stranger, the width of the page also seems to affect whether or not the zoom level resets. If the window is resized to less than 1300px (or thereabouts), it will not reset the zoom level. But on a wider window, the zoom resets.</p>
  <p>I thought this might be because Divi or some other plugin was lazy loading or asynchronously loading the JS. However, I tried disabling any plugins that might be doing this, but the behavior remained.</p>