I'm having an issue with Google Places Autocomplete. This is the setup I'm using:
'https://maps.googleapis.com/maps/api/js?libraries=geometry,places&language=sv®ion=se&key=' + key;
^ This is further up in the file and just here to show what I'm using.
const options = {
types: ['(cities)'],
componentRestrictions: { country: "se" }
};
new google.maps.places.Autocomplete(element, options);
I'm using (cities), because I want to return actual cities only, and not countys or other locality results.
This works fine, however Google seem to make some sort of differentiation between a town registered as a place or an urban area.
For instance, the autocomplete returns the Swedish town Hemse which is a small town with apx 1700 ppl which is an urban area according to Wiki, but at the same time it does not return the bigger city Skene which has apx 5,800 people which is a place according to Wiki.
Is this just something Google does, or is there any way to change what types I'm using to get a wider scope of cities?
question from:
https://stackoverflow.com/questions/65847149/google-places-autocomplete-not-returning-certain-cities 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…