I'm using Jquery UI to autocomplete search for an address using Google Maps Geocoder , and when an address is selected it returns the geocode information. 这是片段:
$('#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 信息?