我想刷新Google地图并发送新的地理定位请求,而无需刷新页面,同时用户在输入时键入地址(城市和地址,国家不变)。我怎样才能做到这一点?如何在输入地址时输入新的地理定位请求并刷新Google地图?
<input type="text" id="input_adress" />
<script type="text/javascript">
function mapk() {
//code about start the map (new google.maps.Map)...
geokoder.geocode({address: 'UK'}, start_geocode);
}
function start_geocode(var1, status) {
//more code...
</script>
现在是我要开始代码:
$(function()
{$('#input_adress').keyup(function() {
});
});
我不知道应该怎样下?可能我需要先选择地图...
geokoder.geocode({address: 'UK '+$('#input_adress').val()}, start_geocode);
我在我的页面上有jQuery库。这够了吗?