initMap is not a function Google Maps Javascript
<p>I know this question has been asked. But I still can't get past it.
I am simply trying to get googlemaps API loaded in js fiddle. I cannot get past the error:initMap is not a function.
My jsfiddle here: <a href="https://jsfiddle.net/ebehrens/mp7j7gy0/53/" rel="nofollow noreferrer">jsfiddle</a></p>

<p>My code:</p>

<pre><code>function initMap() {
    var map = new google.maps.Map(document.getElementById('map'), {
        center: { lat: 34.397, lng: 150.644 },
        scrollwheel: false,
        zoom: 2
    });
</code></pre>

<p>HTML:</p>

<pre><code>  &lt;div id="map" style="width: 500px; height: 400px;"&gt;&lt;/div&gt;
      &lt;script async defer
            src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDieZ7uAY4DPdT3Z4fp4KtykHl6dWryYdw&amp;callback=initMap"&gt;
    &lt;/script&gt;
</code></pre>

<p>When I have the  function initmap(){} (with brackets) the map does not load and I get the error.
When remove the <code>function initmap{}</code>and just:</p>

<pre><code>var map = new google.maps.Map(document.getElementById('map'), {
    center: { lat: 34.397, lng: 150.644 },
    scrollwheel: false,
    zoom: 2
});
</code></pre>

<p>The map loads, however I still get the error:</p>

<p>initMap is not a function </p>

<p>It might have something to do with a callback. I have not written javascript in a while. But I just need to get past this error. Thanks</p>