Google maps 自动完成谷歌地图V3无法定制的地方?

Google maps 自动完成谷歌地图V3无法定制的地方?,google-maps,autocomplete,google-geocoder,Google Maps,Autocomplete,Google Geocoder,我将autocomplete缩小到仅覆盖澳大利亚的一个区域和边界,但我仍在接受智利、中国和选定区域以外的其他国家的autocomplete。 有人有解决这个问题的好办法吗? 我也不能改变Google autocomplete的样式,它是一个带有样式标签的自生成Div,它克服了我的样式来自动完成Div? 我开始使用Geocoder和Jquery autocomplete来过滤结果,但它没有Google autocomplete那么好用。结果比Google maps autocomplete少 我这

我将autocomplete缩小到仅覆盖澳大利亚的一个区域和边界,但我仍在接受智利、中国和选定区域以外的其他国家的autocomplete。 有人有解决这个问题的好办法吗? 我也不能改变Google autocomplete的样式,它是一个带有样式标签的自生成Div,它克服了我的样式来自动完成Div? 我开始使用Geocoder和Jquery autocomplete来过滤结果,但它没有Google autocomplete那么好用。结果比Google maps autocomplete少

我这样称呼图书馆:

以下是创建自动完成的代码:

    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); 

当使用
边界时
,结果将偏向这些边界内包含的位置,但不受限制。这与在中使用时相同。恐怕我没有办法过滤掉那些超出
范围的建议现在,您可以限制在以下国家:


组件限制:{country:'us'},

另一种快速定制的方法是设置组件限制,如下所示

var autocomplete = new google.maps.places.Autocomplete(input);
//autocomplete.bindTo('bounds', map);//restrict to bounds or viewport
autocomplete.setComponentRestrictions({'country': 'uk'});//restrict to country
更多关于地方偏倚的信息问题在于西南角和东北角

而不是:

应该是:

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

实际上是有

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