Текущее местоположение в реакции-нативных-google-местах-автозаполнения - PullRequest
0 голосов
/ 30 сентября 2018

Когда выбрано текущее местоположение, API получает местоположения, но список, кажется, не заполняет / отображает места.Но когда он выбран, он меняет геокод и выводит данные в консоли.

Однако он не устанавливается на textInput.

Не уверен, что мне не хватает

Так выглядит экран

код выглядит так

<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',
  }}
/>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...