我正在使用Google Maps API获取城市和国家/地区的自动填充列表(没有其他详细信息),而且效果很好.
var input = document.getElementById('newAddress');
var options = {
types: ['(cities)']
};
autocomplete = new google.maps.places.Autocomplete(input, options);
Run Code Online (Sandbox Code Playgroud)
现在我想完全相同,但只获得国家名称.像财产以后更换types: ['(cities)'] 与 types: ['(countries)']...
(我试过,但没有工作)
我应该怎么做才能让国家/地区进入我的自动填充功能?