how to solveCurrent location problem react native

Viewed 29

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={() => {}}
     />

I logged, it has data, but it not display in screen. It just display lines like image below.

anyone help me thanks

0 Answers
Related