Found that place.geometry can sometimes be undefined. The google maps docs mention it could be because the user hit enter when no suggestion was present.
Here is the culprit. A simple check and return early would fix it.
handleAutoCompletePlaceChange: function (autocomplete) {
var place = autocomplete.getPlace();
var lat = place.geometry.location.lat();
var lng = place.geometry.location.lng();
this.updateLocationInput(lat, lng, place);
this.fitBoundMarker()
},
from google's docs [1]:
var place = autocomplete.getPlace();
if (!place.geometry) {
// User entered the name of a Place that was not suggested and
// pressed the Enter key, or the Place Details request failed.
...
Hi,
Found that place.geometry can sometimes be undefined. The google maps docs mention it could be because the user hit enter when no suggestion was present.
Here is the culprit. A simple check and return early would fix it.
from google's docs [1]:
[1] https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete#try-it-yourself