我正在使用笨maps.googleapis.com/maps/api顯示自動完成位置,當用戶鍵入拉鍊地址特定國家的郵政編碼。我從第一個用戶的兩個輸入字段選擇國家和第二提起他會鍵入他的郵政編碼,並從谷歌自動完成,他將選擇他的地址。獲取使用谷歌地圖
var directionsService = new google.maps.DirectionsService();
google.maps.event.addDomListener(window, 'load', function() {
new google.maps.places.SearchBox(document.getElementById('zip'));
directionsDisplay = new google.maps.DirectionsRenderer({ 'draggable': true });
});
它工作正常,但現在我想只顯示選定國家的郵政編碼。也就是說,如果用戶選擇澳大利亞作爲國家和型拉鍊像2127那麼谷歌的API應該顯示在地址
您還可以添加類型:「地址解析」進入選項,以避免街道級地址和場所。 – miguev