지오 코딩에 의해 반환 된 검색 결과를 확대하려고합니다. 나는이 같은 http://tech.cibul.org/wp-content/uploads/2010/05/geocode/index.html (자습서 여기 http://tech.cibul.org/geocode-with-google-maps-api-v3/) jquery UI 자동 완성 입력 만들기입니다.지오 코딩 결과 확대 (모든 정치적 반환이 반환 됨)
예를 들어, 위치 표시 줄에 'waterloo'를 입력하면 1 옵션을 얻을 수 있습니다. Waterloo, ON, Canada.
다른 모든 워털루는 어떨까요?
이 http://en.wikipedia.org/wiki/Waterloo이 코드의 핵심입니다 : 내 경험에
$('input[name="location"]').autocomplete({
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()
}
}));
})
}
});
에 대한 당신이 장소 이름의 목록을 제공하려는 경우, 당신은 몇 가지 다른 데이터 소스가 필요하다는 결론에 도달했습니다? –
@pekka 확실히 업데이트되었습니다. –