title: Google Maps error on WordPress site
body: <p>Need your help. I have the error on my WordPress site. Google Maps shows this errors:</p>
  
  <pre><code>Jb {message: "initMap is not a function", name: "InvalidValueError", stack: "Error↵    at new Jb (https://maps.googleapis.com/m…xALxizYJSGZA470&amp;callback=initMap&amp;ver=4.9.5:157:51"}
  </code></pre>
  
  <p>And this</p>
  
  <pre><code>Uncaught TypeError: Cannot read property 'firstChild' of null
  </code></pre>
  
  <p>In my code.js I have this code:</p>
  
  <pre><code>(function ($) {
  
      ...
  
      function initMap(officeLocation, pathMap) {
          var map = new google.maps.Map(document.getElementById(pathMap), {
              zoom: 15,
              center: officeLocation
          });
          var marker = new google.maps.Marker({
              position: officeLocation,
              map: map
          });
      }
  
      showOnKyivMap.on('click', function() {
          mapCover.fadeIn(500);
          initMap(kyivOffice, mapFooter);
      });
  
      $(document).ready(function() {
          initMap(kyivOffice, mapKyivContacts);
      });
  
  })(jQuery);
  </code></pre>
  
  <p>Google Map script is connected in functions.php</p>
  
  <pre><code>wp_enqueue_script( 'google-maps', "https://maps.googleapis.com/maps/api/js?key=AIzaSyAN-c6nn0xMNJB_2SfGxALxizYJSGZA470&amp;callback=initMap", array("code-js"), '', true);
  </code></pre>
  
  <p>So what do I do wrong?</p>