2011-12-22 74 views
1

有没有什么方法可以在显示结果之前插入钩子?我想过滤那些不适合我需要的(即不在我实施的国家)。谷歌地图自动完成,在显示结果之前挂钩

这里是我当前的代码:

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Test</title> 
    <script src="http://maps.google.com/maps/api/js?sensor=false&libraries=places&language=es&region=MX" type="text/javascript"></script> 
    <script type="text/javascript"> 
    function hebe(){ 
     var defaultBounds = new google.maps.LatLngBounds(
      new google.maps.LatLng(18.2397859708389,-99.876708984375), 
      new google.maps.LatLng(20.23127464130257,-97.899169921875) 
     ); 

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

     autocomplete = new google.maps.places.Autocomplete(input); 
     autocomplete.setBounds(defaultBounds) 
    } 

    </script> 
    </head> 
    <body onLoad="hebe();"> 
     <input id="searchTextField" type="text" size="50"> 
    </body> 
</html> 

回答

相关问题