Jquery ui 如何在地理编码过程中扩展autocomplete的源代码
我为谷歌地图创建了一个自动完成字段。这是可行的,但我需要用我自己的观点来扩展地址列表,特别是与。自动完成函数的源选项需要扩展:Jquery ui 如何在地理编码过程中扩展autocomplete的源代码,jquery-ui,google-maps,autocomplete,geocoding,Jquery Ui,Google Maps,Autocomplete,Geocoding,我为谷歌地图创建了一个自动完成字段。这是可行的,但我需要用我自己的观点来扩展地址列表,特别是与。自动完成函数的源选项需要扩展: gc = new google.maps.Geocoder(); $(Element).autocomplete({ source: function(request, response) { gc.geocode( {'address': request.term }, function(results, status) {
gc = new google.maps.Geocoder();
$(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: ...
});
有什么想法吗?谢谢您的期待那么您需要链接到的类别功能以及您在这里拥有的功能吗?