[eluser]Unknown[/eluser]
Hello,
I have a problem because I have the complete address of a place in my DB, but I would like get the coords and save it in the DB.
My code in javascript is (I don't know how I would return the "latlong" for save it in DB):
Code:
function encodeAddress(direcc) {
var latlong = '';
var geocoder = new google.maps.Geocoder();
geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': direcc}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
latlong = results[0].geometry.location;
} else { alert("ERROR" + status);}
});
return latlong;
}