Autocomplete Google Map V3 Places that cannot be customized?

I narrowed autocomplete to a region and to borders covering only Australia, but I still get autocomplete from Chile and China and another country from a selected area. Does anyone have a good solution to solve this problem? I also can’t change the Google autocomplete style, is it a self-generated Div with a style tag that overcomes my DIV autocomplete style? I started using Geocoder and Jquery autocomplete to filter the results, but it doesn’t work like Google Autocomplete. Results are less than autocompletion of Google maps.

I call the library as follows:

Here is the autocomplete creation code:

var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(-47.5765257137462, 106.259765625), new google.maps.LatLng(-9.6, 179.359375)); var options = { bounds: defaultBounds, types: ['geocode'], offset: 5 }; var input = document.getElementById('store-locator-header'); var autocomplete = new google.maps.places.Autocomplete(input,options); 
+7
source share
4 answers

You can currently limit the country:

componentRestrictions: {country: 'us'},

+4
source

When adding autocomplete with bounds , the results are biased , but not limited to, Places contained within these boundaries. This is the same as using Viewport Biasing in the Geocoding API . I'm afraid I have no way to filter out offers that go beyond bounds .

+2
source

Another way to configure qucikly may be to set a component constraint, as shown below.

 var autocomplete = new google.maps.places.Autocomplete(input); //autocomplete.bindTo('bounds', map);//restrict to bounds or viewport autocomplete.setComponentRestrictions({'country': 'uk'});//restrict to country 

more about offsets here

0
source

The problem is that LatLngBounds expects southwest and northeast angles.

Instead:

 var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(-47.5765257137462, 106.259765625), new google.maps.LatLng(-9.6, 179.359375)); 

It should be:

 var defaultBounds = new google.maps.LatLngBounds( new google.maps.LatLng(-9.6, 106.259765625), new google.maps.LatLng(-47.5765257137462, 179.359375)); 

Actually documentation for styling autocomplete user interface elements .

0
source

All Articles