Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
Google Places Autocomplete API Get Specific Address Component without Loops or Conditions

Is it possible to get specific address_components from Google Places Autocomplete without having to use loops or conditions? I am trying to understand the loop thing from the sample code of the documentation and was wondering why not just refer it directly instead?

I tried

function fillInAddress() {
  // Get the place details from the autocomplete object.
  var place = autocomplete.getPlace();

  document.getElementById('autocomplete-streetNumber').value = place.address_components.street_number;
  document.getElementById('streetName').value = place.address_components.route;
  document.getElementById('suburb').value = place.address_components.locality;
  document.getElementById('postCode').value = place.address_components.postal_Code;
}

but I get undefined. Not sure if I am missing something.

I also tried places.address_components[0] and I get [object Object].

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda