Current location problem
See original GitHub issueWhen clicking on “Use my current location”, it writes on text input “Use my current location” and nothing seems to happen.
Normal autocomplete queries works perfectly.
<GooglePlacesAutocomplete
placeholder={LocalizedStrings.search}
minLength={2} // minimum length of text to search
autoFocus={false}
textInputProps={{
onChangeText: (text) => {
if (!text.length) {
this.address = '';
this.latlng = null;
}
}
}}
returnKeyType={'search'}
listViewDisplayed={'auto'}
fetchDetails={true}
renderDescription={row => row.description || row.vicinity}
onPress={(data, details = null) => {
console.log(data, details);
if (details && details.formatted_address) {
this.address = details.formatted_address;
}
if (details && details.geometry && details.geometry.location) {
this.latlng = details.geometry.location;
}
}}
getDefaultValue={() => ''}
query={{
key: 'my_key',
language: 'es', // language of the results
types: 'geocode' // default: 'geocode'
}}
styles={{
textInputContainer: {
width: '100%',
backgroundColor: 'white',
borderTopWidth: 0
},
textInput: {
backgroundColor: 'white',
fontFamily: Fonts.regular,
color: Colors.gray_regular
},
description: {
fontFamily: Fonts.bold,
color: Colors.gray_bold
},
predefinedPlacesDescription: {
color: Colors.accent_color
}
}}
currentLocation={true}
currentLocationLabel={LocalizedStrings.current_location}
nearbyPlacesAPI={'GooglePlacesSearch'}
GoogleReverseGeocodingQuery={{
// available options for GoogleReverseGeocoding API : https://developers.google.com/maps/documentation/geocoding/intro
}}
GooglePlacesSearchQuery={{
// available options for GooglePlacesSearch API : https://developers.google.com/places/web-service/search
rankby: 'distance'
}}
filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']} // filter the reverse geocoding results by types - ['locality', 'administrative_area_level_3'] if you want to display only cities
debounce={200}
renderLeftButton={() => {}}
renderRightButton={() => {}}
/>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:9
Top Results From Across the Web
Find & improve your location's accuracy - Google Maps Help
Google Maps may have trouble finding your location. If the GPS location of your blue dot on the map is inaccurate or missing,...
Read more >Top 6 Ways to Fix Location Services Not Working on Android
Top 6 Ways to Fix Location Services Not Working on Android · 1. Enable and Disable Airplane Mode · 2. Enable Google Location...
Read more >If Maps isn't working on your Apple device
Turn on Location Services and Location Access for Maps. In the Settings app, tap Privacy, then tap Location Services.
Read more >How To Fix Google Maps Showing Wrong GPS Location on ...
Go to Settings and look for the option named Location and ensure that your location services are ON. · Now the first option...
Read more >11 methods to fix Android GPS not working - Carlcare
Being able to share your location with friends, retrieving a misplaced phone, tracking your run, navigating through unknown places is so cool ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, Its not a issue, see the renderDescription props
renderDescription={row => row.description || row.formatted_address || row.name}
In case anyone else has this issue, but still wants to display the row descriptions, changing
nearbyPlacesAPI='GooglePlacesSearch'
tonearbyPlacesAPI="GoogleReverseGeocoding"
did it for me.