Google GeoCode Autocomplete limit State

后端 未结 2 1798
南旧
南旧 2021-01-20 01:26

I am trying to add an Google Geocode Autocomplete field to my form.

I have been able to get it to restrict the results returned to the country (AU) but it would be e

2条回答
  •  粉色の甜心
    2021-01-20 01:57

    I use autocomplete without any sort of filter on it but automatically append the state I'm interested in to all of the user input before sending the query.

    For someone who wants California results, for example, if they were to search for Sacramento it would automatically correct the input to Sacramento, California and this has worked somewhat well for me. You could be even more specific with the data you send, for example Sacramento, California, USA

提交回复
热议问题