限制Google地方信息自动填充功能仅返回地址 [英] Restrict Google Places Autocomplete to return addresses only

查看:77
本文介绍了限制Google地方信息自动填充功能仅返回地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

autocomplete = new google.maps.places.Autocomplete(input, { types: ['geocode'] });

在其他较大区域中返回街道和城市.只能限制在街道上吗?

returns streets and cities amongst other larger areas. Is it possible to restrict to streets only?

推荐答案

我认为您想要的是{ types: ['address'] }.

您可以通过以下实时示例看到这一点: https: //developers.google.com/maps/documentation/javascript/examples/places-autocomplete (使用地址"单选按钮).

You can see this in action with this live sample: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete (use the "Addresses" radio button).

这篇关于限制Google地方信息自动填充功能仅返回地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆