React-native-google-places-autocomplete: Add the componentRestrictions option

Created on 12 Feb 2017  路  2Comments  路  Source: FaridSafi/react-native-google-places-autocomplete

Hi, wondering if you can add the functionality that will restrict the result of autocomplete based on the country option?

Most helpful comment

Never Mind. Just found out the way to do it. Should've checked it earlier.

Just need to pass down the components attribute with the value of the country you want to be restricted to.

query={{
key: GoogleMapAPIKey,
components: 'country:nz'
}}

All 2 comments

Never Mind. Just found out the way to do it. Should've checked it earlier.

Just need to pass down the components attribute with the value of the country you want to be restricted to.

query={{
key: GoogleMapAPIKey,
components: 'country:nz'
}}

if you need to filter for multiple countries add it like this

components: 'country:at|country:de'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

akhlopyk picture akhlopyk  路  3Comments

RajanPN picture RajanPN  路  3Comments

macs03 picture macs03  路  3Comments

diegothucao picture diegothucao  路  3Comments

tezahzulueta picture tezahzulueta  路  3Comments