Is there a way to display the address inputted into 4 textboxes (with pin changing after onchange) on a Google map embedded on my website? I want to have 4 separate input fields for zip code, city, street, and house number. If all four boxes are filled out with more than 4 letters each, then the full address should be displayed on the map.
I attempted to use the demo code provided on the download page.
$(function(){
$('#test').gmap3({
map:{
options:{
center:[46.721976,14.180603],
zoom:8,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
mapTypeControlOptions: false,
navigationControl: false,
scrollwheel: false,
streetViewControl: false
}
}
});
$('#test-address').keydown(function(e){
var addr = $('#test-address').val();
if ( !addr || !addr.length ) return;
$("#test").gmap3({
getlatlng:{
address: addr,
callback: function(results){
if ( !results ) return;
$(this).gmap3({
marker:{
latLng:results[0].geometry.location,
map:{
center: true
}
}
});
}
}
});
});
});
However, I would like to achieve this functionality using information from four input boxes combined.
Any suggestions on how I can accomplish this?