add restrictions country de in address result

master
Gustavo Luigi 2022-09-01 13:27:25 +02:00
parent a557e17586
commit fe0980d45a
1 changed files with 3 additions and 2 deletions

View File

@ -185,8 +185,9 @@
}
function initialize() {
clearAddressFields();
var input = document.getElementById('field_location');
var autocomplete = new google.maps.places.Autocomplete(input);
let input = document.getElementById('field_location');
let options = { componentRestrictions: {country: "de"} };
var autocomplete = new google.maps.places.Autocomplete(input, options);
autocomplete.addListener("place_changed", () => {
const place = autocomplete.getPlace();
if (!place.geometry) return;