ErrorPro / react-google-autocomplete

React components for google places API.
MIT License
462 stars 114 forks source link

Autocomplete not Searching with Street Address or Number #218

Closed MusahMusah closed 11 months ago

MusahMusah commented 1 year ago

I have been having issues whenever i use the package to search for address with street number.

Example: 56 F5 Streeet Citec Estate.

The example above contains the house number and street address, therefore the package always returns empty result for similar search. However, When you search with City name it works fine.

Bat-Orgil7 commented 12 months ago

You can specify places types like this: <ReactGoogleAutocomplete apiKey={process.env.GOOGLE_KEY} onPlaceSelected={selected => console.log(selected)} options={{ types: 'locality' }}/>

options.types is set to 'cities' by default. You can check other types here: https://developers.google.com/maps/documentation/places/web-service/supported_types