I want to refresh Google Map and send new geolocalization request without refreshing the page and while user typing address (city and address, country is constant) on input. How can I do that?
<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>
And now is the code from which I want to start:
$(function()
{$('#input_adress').keyup(function() {
});
});
I’m not sure what should next? Probably I need to select the map first…
geokoder.geocode({address: 'UK '+$('#input_adress').val()}, start_geocode);
I have jQuery library on my page. Is this enough?
Try something like this :
this uses
clickon a button to search but you could use keypress / change on the input.Working example here