question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Current location problem

See original GitHub issue

When 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:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:9

github_iconTop GitHub Comments

17reactions
dagrinchicommented, Apr 1, 2018

Hello, Its not a issue, see the renderDescription props

renderDescription={row => row.description || row.formatted_address || row.name}

11reactions
adlondoncommented, Mar 30, 2018

In case anyone else has this issue, but still wants to display the row descriptions, changing nearbyPlacesAPI='GooglePlacesSearch' to nearbyPlacesAPI="GoogleReverseGeocoding" did it for me.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found