I create an autocomplete field like that for the Google Maps. It's working, but I need to extend the address list with my own points (specifically with category). The autocomplete function's source option needs the extending:
gc = new google.maps.Ge开发者_如何转开发ocoder();
$(Element).autocomplete({
source: function(request, response) {
gc.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()
}
}))
})
},
select: ...
});
Any idea? Thank you in anticipation
精彩评论