谷歌地方自动完成不返回某些城市

问题描述

我在使用 Google 地方信息自动完成功能时遇到了问题。这是我正在使用的设置:

'https://maps.googleapis.com/maps/api/js?libraries=geometry,places&language=sv&region=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);

我使用(城市),因为我只想返回实际的城市,而不是县或其他地方的结果。

这很好用,但是 Google 似乎对注册地点市区的城镇进行了某种区分。

例如,自动完成返回瑞典小镇 Hemse,根据 Wiki,它是一个 apx 1700 ppl 的小镇,它是一个市区,但同时它不会返回更大的城市Skene 拥有 5,800 人,根据 Wiki 是一个地方

这只是 Google 所做的事情,还是有什么方法可以更改我使用的类型以获取更广泛的城市范围?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)