I am currently using the google apis API to autocomplete locations. I can set it to only return the regions type with "autocomplete.setTypes(['regions'])" . Looking at the documentation I can see that regions type will return all results containing the following types;
* locality
* sublocality
* postal_code
* country
* administrative_area1
* administrative_area2
What I want to achieve though, is to only return autocomplete predictions with the region type "sublocality". Is this possible? If not has anybody had a similar issue and have an alternative solution they would recommend? Thank you.
var autocomplete = new google.maps.places.Autocomplete(input);
var types = ['(regions)'];
var options = {
componentRestrictions: {country: 'uk'}
};
autocomplete.setTypes(types);
autocomplete.setOptions(options);