ErrorPro / react-google-autocomplete

React components for google places API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autocomplete not Searching with Street Address or Number

MusahMusah opened this issue · comments

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.

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