React-native-google-places-autocomplete: Bias search does not work

Created on 14 Aug 2020  路  3Comments  路  Source: FaridSafi/react-native-google-places-autocomplete

Hi @FaridSafi ,
I am using your library for my projects to search google places. The library is very nice and helpful for me.
In order to priority the places that is near my location, i use location properties but seems it does not work.

   query={{
              key: setting.GOOGLE_PLACES_API_KEY,
              language: 'en',
              radius: 10000,
              location: {
                latitude: 21.028511,
                longitude: 105.804817
              }
            }}

When i tap A to search , it does not show the places that is near the above location, it shows some places they are so far from above one.

Could you support me what is my issue and how to fix it.

Thanks in advance,
Thu

Most helpful comment

Location needs to be a string. As per the docs.

image

 query={{
              key: setting.GOOGLE_PLACES_API_KEY,
              language: 'en',
              radius: 10000,
              location: "21.028511,105.804817"
            }}

The definitions file was updated in #585 a while back.

All 3 comments

Hi,

I'm facing the same issue. I've tried to use:

GooglePlacesSearchQuery={{
              location: {
                latitude: 53.958332,
                longitude:  -1.080278,
              },
              radius: 5000
            }}

But it still doesn't work.
Could someone please help to fix?

Location needs to be a string. As per the docs.

image

 query={{
              key: setting.GOOGLE_PLACES_API_KEY,
              language: 'en',
              radius: 10000,
              location: "21.028511,105.804817"
            }}

The definitions file was updated in #585 a while back.

Thanks so much @bell-steven. It works now.
I really appreciate.

Was this page helpful?
0 / 5 - 0 ratings