Restrict Google Places Autocomplete to return addresses only

血红的双手。 提交于 2020-01-12 06:28:25

问题


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?


回答1:


I think what you want is { types: ['address'] }.

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).



来源:https://stackoverflow.com/questions/15071589/restrict-google-places-autocomplete-to-return-addresses-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!