title: latlng.lat show NaN in google maps
body: <p>I am implementing the Google Maps API, i need to do is that when I click on the map should capture the coordinates, longitude and latitude in separate fields of text, ie an input display length and another input latitude of moment could capture the coordinates and clicking but when I check with console.log (latlng.lat); NAN shows the value while console.log (latlng.lng); works well for showing me coordinate properly.</p>
  
  <p>when i add in file .js this line: var geocoder = new google.maps.Geocoder();</p>
  
  <p>show this error:  Uncaught Eb {message: "initMap is not a function", name: "InvalidValueError", stack: "Error↵    at new Eb (<a href="https://maps.googleapis.com/m" rel="nofollow">https://maps.googleapis.com/m</a>…MY_API_KEY&amp;callback=initMap:131:73"}</p>
  
  <p>please help me.</p>
  
  <p>HTML: </p>
  
  <pre><code>&lt;div id="map-wrapper"&gt;
      &lt;div id="floating-panel"&gt;
  
        &lt;label&gt;latitud y longitus juntas:&lt;/label&gt;
        &lt;input id="latlng" type="text" value="40.714224,-73.961452"&gt;
  
        &lt;label&gt;latitud&lt;/label&gt;
        &lt;input id="latitud" type="text" value=""&gt;
  
        &lt;label&gt;Longitud&lt;/label&gt;
        &lt;input id="longitud" type="text" value=""&gt;
  
        &lt;input id="submit" type="button" value="Geocode"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
        &lt;div id="map"&gt;&lt;/div&gt;  
        &lt;script src="https://maps.googleapis.com/maps/api/js?key=MY_API_KEY&amp;callback=initMap" async defer&gt;&lt;/script&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>function initMap() {
    var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 20,
      center: {lat: -34.397, lng: 150.644}
    });
    var geocoder = new google.maps.Geocoder();
  
    document.getElementById('submit').addEventListener('click', function() {
      geocodeAddress(geocoder, map);
    });
  
    map.addListener('click', function(e) {
      placeMarkerAndPanTo(e.latLng, map);
    });
  
    var infowindow = new google.maps.InfoWindow;
  }
  
  function placeMarkerAndPanTo(latLng, map, infowindow) {
    var marker = new google.maps.Marker({
      position: latLng,
      map: map
    });
    map.panTo(latLng);
  
    console.log('la latitud y longitud inicial  son: '+ latLng);
    jQuery('#latlng').val(latLng);
    var input = document.getElementById('latlng').value;
    console.log('la latitud y longitud nuevas son: '+ input);
    var latlngStr = input.split(',', 2);
    var latlng = {lat: parseFloat(latlngStr[0]), lng: parseFloat(latlngStr[1])};
    console.log('la longitud real es: '+ latlng.lng);
    console.log('la latitud real es: '+ latlng.lat);
  }
  </code></pre>