与jquery ui自动完成一起使用时如何在地理编码中使用组件过滤
$("#address").autocomplete({
//This bit uses the geocoder to fetch address values
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,
latitude: item.geometry.location.lat(),
longitude: item.geometry.location.lng(),
loc :item.formatted_address
}
}));
})
})
})
我想要像这样的组件过滤http://maps.google.com/maps/api/geocode/json?address=santa+cruz&components=country:ES&sensor=false