function initAutocomplete() {
var lat=document.getElementById(\'lat\').value;
var lng=document.getElementById(\'lng\').value;
console.log(lat);
console.l
Same error, slightly different scenario:
I kept getting this error (same as the OP) when trying to use the autocompleted lat/lng to update a map:
var place = autocomplete.getPlace();
var geo = place.geometry.location;
loadMapAt(new google.maps.LatLng(geo.lat, geo.lng));
This "one weird trick" fixed it. Replacing the second line with:
var geo = JSON.parse(JSON.stringify(place.geometry.location));