Google Maps autocomplete does not show address

Asked

Viewed 242 times

1

I’m trying to get my Google Maps autocomplete to show the address in the formed "City - State, Country" however, is returning this:

inserir a descrição da imagem aqui

In short, it only returns with the city, but you can’t tell where it’s from.

I tested it that way:

var input = document.getElementById('address');

$(function () {
    var options = {
       types: ['(cities)']
    };
    var autocomplete = new google.maps.places.Autocomplete(input, options);
});

And in the JS:

<script src="https://maps.googleapis.com/maps/api/js?key=****&libraries=places"></script>

Even if I remove the types: ['(cities)'] still not showing the rest of the address.

I left something to do?

  • I believe that one possible way is to use the service and put yourself in a select. Take a look at this example here https://jsfiddle.net/b1ws2h07/69/

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.