I am developing an application for a specific city and like it when the User typed the street it suggested some related names, this part I got, I'm using AutoComplete.js but would limit the search that city, without showing the others. I searched the documentation but did not quite understand, I can limit po zip code, city name or something?
$("#InputEndereco").autocomplete({
source: function (request, response) {
geocoder.geocode({ 'address': request.term + ', Brasil', 'region': 'BR' }, function (results, status) {
response($.map(results, function (item) {
return {
label: item.formatted_address,
value: item.formatted_address,
latitude: item.geometry.location.lat(),
longitude: item.geometry.location.lng()
}
}));
})
}
});