Maps autocomplete v3 does not show some cities

-1

My client has a website built with wordpress using a theme that allows you to register and search for people that are displayed on a map. We need support because the field of search of places does not show some suggestions like for example "avenida paulista", must be something related to the api V3 of Google. This is my website . We need autocomplete to behave the same in this example:

link .

My code looks like this:

link

    
asked by anonymous 11.02.2014 / 18:05

1 answer

0

Dude, I did not look at your code. very extensive.

To help us help you, create a jsfiddle with only the relevant part, so we can edit and see it working online.

For your luck, I've already answered this question in the [SO] in English.

Here's a jsfiddle with autocomplete running: link just type "avenue p" into the search field.

The important part for you is this:

var input = document.getElementById('nptsearch');
var autocomplete = new google.maps.places.Autocomplete(input);

autocomplete.bindTo('bounds', map);

google.maps.event.addListener(autocomplete, 'place_changed', function() {
    infowindow.close();
    var place = autocomplete.getPlace();
    if (place.geometry.viewport) {
        map.fitBounds(place.geometry.viewport);
    } 
    else {
        map.setCenter(place.geometry.location);
        map.setZoom(7);
    }
})
    
20.03.2014 / 16:29