Google地方信息自动填充功能 - 如何仅显示国家/地区名称

时间:2014-12-09 00:35:54

标签: google-maps-api-3 autocomplete filtering google-places-api search-box

我希望用户在搜索框中输入时只能看到国家/地区名称。有可能吗?

enter image description here

我已经尝试过这个(没有用):

var options = {
    types: [('regions')]
};

var searchBox = new google.maps.places.SearchBox(input, options);

1 个答案:

答案 0 :(得分:3)

Google允许您使用某些属性来获取您想要的数据。您可以将其设置为语言和其他任何内容。 这是一个链接,可以帮助您。 http://www.w3docs.com/learn-javascript/places-autocomplete.html

相关问题