Current location list issue
See original GitHub issueCan someone please help in identify where I am going wrong. The current location is getting picked up but the list is not getting shown properly.
`<GooglePlacesAutocomplete placeholder=‘Deliver To’ minLength={2} // minimum length of text to search autoFocus={false} returnKeyType={‘search’} // Can be left out for default return key https://facebook.github.io/react-native/docs/textinput.html#returnkeytype listViewDisplayed=‘auto’ // true/false/undefined fetchDetails={true} renderDescription={row => row.description || row.vicinity} // custom description render onPress={(data, details = null) => { // ‘details’ is provided when fetchDetails = true console.log(data, details); }} getDefaultValue={() => ‘’} query={{ // available options: https://developers.google.com/places/web-service/autocomplete key: ‘’, language: ‘en’, // language of the results types: ‘geocode’, // default: ‘geocode’ components: ‘country:au’, }}
styles={{
textInputContainer: {
width: '100%',
backgroundColor: 'rgba(0,0,0,0)',
borderLeftWidth: 0.5,
borderRightWidth: 0.5,
},
textInput: {
fontFamily: "AvenirMedium",
fontSize: 17,
color: "#000",
backgroundColor: 'rgba(0,0,0,0)',
},
description: {
fontWeight: 'bold'
},
predefinedPlacesDescription: {
color: '#1faadb'
}
}}
currentLocation={true} // Will add a 'Current location' button at the top of the predefined places list
currentLocationLabel="Current location"
nearbyPlacesAPI={'GoogleReverseGeocoding'} // Which API to use: GoogleReverseGeocoding or GooglePlacesSearch
GoogleReverseGeocodingQuery={{
// available options for GoogleReverseGeocoding API : https://developers.google.com/maps/documentation/geocoding/intro
key: '',
language: 'en',
}}
/>
`
Issue Analytics
- State:
- Created 5 years ago
- Comments:11
Top GitHub Comments
I had a similar issue. On my end the list did get populated, but looked exactly like yours. The issue was the render details property didnt work. You have: renderDescription={row => row.description || row.vicinity} // custom description render i had: renderDescription={row => row.description }
Removing the render description fixed the issue for me. Havent played around to get it to work with the renderDescription property yet.
However, the current location now renders names of places, but i want it to show addresses, and i cant get it to cooporate with that…
Hi @sazo2300 , Thanks a lot. That seemed to have solved the issue. My code retrieves the address now. Please let me know if you need any help with retrieving specific address. Thanks.