ジオコーディングによって返される検索結果を広げようとしています。私は基本的に、このhttp://tech.cibul.org/wp-content/uploads/2010/05/geocode/index.htmlのような jquery ui オートコンプリート入力を作成しています(チュートリアルはこちらhttp://tech.cibul.org/ geocode-with-google-maps-api-v3/ )。
たとえば、ロケーション バーに「waterloo」と入力すると、Waterloo, ON, Canadaという 1 つのオプションが表示されます。
他のすべてのウォータールーはどうですか?http://en.wikipedia.org/wiki/ウォータールー
これがコードの要点です:
$('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()
}
}));
})
}
});