Google places api 谷歌设置自动完成国家限制

Google places api 谷歌设置自动完成国家限制,google-places-api,restriction,country,Google Places Api,Restriction,Country,有没有办法让Google Places自动完成功能仅限于法国这样的国家 我有这个:components=country:fr https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places&language=fr&components=country:fr&key=API_KEY 但这并没有限制自动完成。这段代码适合我 var input = document

有没有办法让Google Places自动完成功能仅限于法国这样的国家

我有这个:
components=country:fr

https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=places&language=fr&components=country:fr&key=API_KEY

但这并没有限制自动完成。

这段代码适合我

var input = document.getElementById('city_field');
    var options = {
      types: ['(cities)'],
      componentRestrictions: {country: countryCode},
        language: "en"
    };

    autocomplete = new google.maps.places.Autocomplete(input, options);
仔细检查参数name components=country:fr语法