Jquery UIを使用して、Google Maps Geocoderを使用して住所のオートコンプリート検索を行っています。住所を選択すると、ジオコード情報が返されます。スニペットは次のとおりです。
$('#address-dropdown').autocomplete({
//Use geocoder to fetch lat+long values from an address input using google maps API
source: function(request, response) {
geocoder.geocode( {'address': request.term }, function(results, status) {
response($.map(results, function(item) {
return {
label: item.formatted_address,
value: item.formatted_address,
location: item.geometry.location,
latitude: item.geometry.location.lat(),
longitude: item.geometry.location.lng()
}
}));
})
},
使用「postal_code」を返して、許容範囲内にあるかどうかを確認する必要があります。出力例を次に示します。http://maps.googleapis.com/maps/api/geocode/json?address = 1601 + Main + St + Eaton + Rapids + MI + 48864&sensor = false
postal_code情報をターゲットにするにはどうすればよいですか?