本文介绍了自动完成谷歌地图V3放置不可能定制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我自动完成收窄到一个区域,并仅覆盖澳大利亚的边界,但我仍然receving与智利和中国等国家的自动完成出所选区域。
有没有人有一个很好的解决方案来解决这个问题呢?
我也无法改变造型关闭谷歌自动完成,它与风格标签克服我的风格,就能自动生成DIV股利自我?
我开始使用地理codeR和jQuery自动完成过滤结果,但如谷歌自动完成结果低于谷歌地图自动完成它不起作用呢?

我所说的图书馆是这样的:

下面是创建自动完成的code:

  VAR defaultBounds =新的google.maps.LatLngBounds(
    新google.maps.LatLng(-47.5765257137462,106.259765625)
    新google.maps.LatLng(-9.6,179.359375));    VAR的选择= {
      范围:defaultBounds,
      类型:['地理code'],
      偏移:5
    };    VAR输入=的document.getElementById('商店定位器头');    无功自动完成=新google.maps.places.Autocomplete(输入,期权);


解决方案

如今,你可以限制一个国家:

componentRestrictions:{国家:'我们'}

I narrowed autocomplete to a region and to a bounds that cover only Australia, but I am still receving autocomplete with Chile and China and other country out of the selected area.Does anyone have a good solution to work this problem?I also can't change the styling off Google autocomplete, it is a self generated Div with style tag that overcomes my style to autocomplete DIV?I started to use Geocoder and Jquery autocomplete to filter the results but it doesn't work as well as Google Autocomplete the results are less than google maps autocomplete?

I call the Library like this:

Here is the code of creating the auto complete:

    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); 
解决方案

Nowadays, you can restrict to a country with:

componentRestrictions: {country: 'us'},

这篇关于自动完成谷歌地图V3放置不可能定制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 08:10