Hi,
Could you add latitude and longitude in the google address widget ?
Thanks
Could you add latitude and longitude in the google address widget ?
Thanks
prospect_town = jQuery("#prospect_town");
prospect_country = jQuery("#prospect_country");
prospect_state = jQuery("#prospect_state");
jQuery(countries).on("change", function(){
prospect_country.val(countries.val());
});
jQuery(countries).on("change", function(){
prospect_state.val(states.val());
prospect_country.val(countries.val());
getLatLngFromAddress( prospect_town.val(), prospect_country.val() )
});
function getLatLngFromAddress(town, country){
var address = town +", "+ country;
var geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
jQuery('#latitude').val(results[0].geometry.location.Pa);
jQuery('#longitude').val(results[0].geometry.location.Qa);
} else {
console.log("Geocode was not successful for the following reason: " + status);
}
});
}