如何过滤谷歌地方自动填充建议?

问题描述 投票:0回答:1

如何使谷歌自动完成只建议有邮政编码和门牌号码的地方?我希望能够只选择带有邮政编码的房子。

我尝试过的:

const autocompleteConfig = {
    componentRestrictions: { country: {{country}} },
    types: ['address'],
};

const autocomplete = new google.maps.places.Autocomplete({{element}}, autocompleteConfig);

我得到的结果的问题 - 一些建议没有邮政编码或门牌号码。

javascript googleplacesautocomplete
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.