2012-10-17 23 views

回答

0

componentRestrictions可用於限制結果到特定的組。目前,您可以使用componentRestrictions按國家進行過濾。該國必須爲作爲兩個字符,ISO 3166-1α-2兼容的國家代碼傳遞

var input = document.getElementById('searchTextField'); 
var options = { 
    bounds: defaultBounds, 
    types: ['establishment'] 
}; 

autocomplete = new google.maps.places.Autocomplete(input, options); 

來源:https://developers.google.com/maps/documentation/javascript/places#adding_autocomplete

相關問題