18 lines
499 B
JavaScript
18 lines
499 B
JavaScript
|
var input = document.getElementById('destination');
|
||
|
var options = {
|
||
|
types: ['(cities)'],
|
||
|
componentRestrictions: {country: 'at'},
|
||
|
language: language
|
||
|
};
|
||
|
|
||
|
autocomplete = new google.maps.places.Autocomplete(input, options);
|
||
|
autocomplete.setFields(['geometry']);
|
||
|
autocomplete.addListener('place_changed', fillInAddress);
|
||
|
|
||
|
function fillInAddress() {
|
||
|
// Get the place details from the autocomplete object.
|
||
|
var place = autocomplete.getPlace();
|
||
|
|
||
|
alert(place.geometry.location.lat());
|
||
|
}
|
||
|
|